mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-18 15:51:27 +08:00
Implement Final[...] in a way so it doesn't completely fail
This commit is contained in:
1 parent
b27a7dde18
commit
6473ddc28c
2 files changed
+16
-3
No files matched your search
@@ -33,7 +33,8 @@ _TYPE_ALIAS_TYPES = {
|
||||
'DefaultDict': 'collections.defaultdict',
|
||||
'Deque': 'collections.deque',
|
||||
}
|
||||
_PROXY_TYPES = 'Optional Union ClassVar Annotated'.split()
|
||||
_PROXY_TYPES = ['Optional', 'Union', 'ClassVar', 'Annotated', 'Final']
|
||||
_IGNORE_ANNOTATION_PARTS = ['ClassVar', 'Annotated', 'Final']
|
||||
|
||||
|
||||
class TypingModuleName(NameWrapper):
|
||||
@@ -114,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 ['ClassVar', 'Annotated']:
|
||||
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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user