mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-17 22:09:37 +08:00
Tests for Type[]
This commit is contained in:
@@ -17,7 +17,7 @@ from jedi.evaluate.helpers import is_string
|
|||||||
from jedi.evaluate.imports import Importer
|
from jedi.evaluate.imports import Importer
|
||||||
from jedi.evaluate.context import ClassContext
|
from jedi.evaluate.context import ClassContext
|
||||||
|
|
||||||
_PROXY_CLASS_TYPES = 'Tuple Generic Protocol'.split()
|
_PROXY_CLASS_TYPES = 'Tuple Generic Protocol Callable Type'.split()
|
||||||
_TYPE_ALIAS_TYPES = {
|
_TYPE_ALIAS_TYPES = {
|
||||||
'List': 'builtins.list',
|
'List': 'builtins.list',
|
||||||
'Dict': 'builtins.dict',
|
'Dict': 'builtins.dict',
|
||||||
@@ -28,7 +28,7 @@ _TYPE_ALIAS_TYPES = {
|
|||||||
'DefaultDict': 'collections.defaultdict',
|
'DefaultDict': 'collections.defaultdict',
|
||||||
'Deque': 'collections.deque',
|
'Deque': 'collections.deque',
|
||||||
}
|
}
|
||||||
_PROXY_TYPES = 'Optional Union Callable Type ClassVar'.split()
|
_PROXY_TYPES = 'Optional Union ClassVar'.split()
|
||||||
|
|
||||||
|
|
||||||
class TypingName(AbstractTreeName):
|
class TypingName(AbstractTreeName):
|
||||||
@@ -76,7 +76,6 @@ class TypingModuleName(NameWrapper):
|
|||||||
return ContextSet.from_iterable(self._remap())
|
return ContextSet.from_iterable(self._remap())
|
||||||
|
|
||||||
def _remap(self):
|
def _remap(self):
|
||||||
# TODO we don't want the SpecialForm bullshit
|
|
||||||
name = self.string_name
|
name = self.string_name
|
||||||
evaluator = self.parent_context.evaluator
|
evaluator = self.parent_context.evaluator
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -330,3 +330,7 @@ else:
|
|||||||
with_type_checking
|
with_type_checking
|
||||||
#?
|
#?
|
||||||
without_type_checking
|
without_type_checking
|
||||||
|
|
||||||
|
def foo() -> typing.Type[int]: pass
|
||||||
|
#? int
|
||||||
|
foo()
|
||||||
|
|||||||
Reference in New Issue
Block a user