1
0
forked from VimPlug/jedi

Ignore Final/ClassVar if they don't have a generic assignment

This commit is contained in:
Dave Halter
2026-04-28 17:05:43 +02:00
parent 6473ddc28c
commit 75f1d064d5
4 changed files with 58 additions and 20 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ _TYPE_ALIAS_TYPES = {
'Deque': 'collections.deque',
}
_PROXY_TYPES = ['Optional', 'Union', 'ClassVar', 'Annotated', 'Final']
_IGNORE_ANNOTATION_PARTS = ['ClassVar', 'Annotated', 'Final']
IGNORE_ANNOTATION_PARTS = ['ClassVar', 'Annotated', 'Final']
class TypingModuleName(NameWrapper):
@@ -115,7 +115,7 @@ class ProxyWithGenerics(BaseTypingClassWithGenerics):
elif string_name == 'Type':
# The type is actually already given in the index_value
return self._generics_manager[0]
elif string_name in _IGNORE_ANNOTATION_PARTS:
elif string_name in IGNORE_ANNOTATION_PARTS:
# For now don't do anything here, ClassVars are always used.
return self._generics_manager[0].execute_annotation()