mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Type aliases should not have a signature
This commit is contained in:
@@ -275,6 +275,9 @@ class TypeAlias(LazyValueWrapper):
|
|||||||
def gather_annotation_classes(self):
|
def gather_annotation_classes(self):
|
||||||
return ValueSet([self._get_wrapped_value()])
|
return ValueSet([self._get_wrapped_value()])
|
||||||
|
|
||||||
|
def get_signatures(self):
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
class Callable(BaseTypingInstance):
|
class Callable(BaseTypingInstance):
|
||||||
def py__call__(self, arguments):
|
def py__call__(self, arguments):
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ class X:
|
|||||||
|
|
||||||
('import contextlib\n@contextlib.contextmanager\ndef f(x): pass\nf(', 'f(x)'),
|
('import contextlib\n@contextlib.contextmanager\ndef f(x): pass\nf(', 'f(x)'),
|
||||||
|
|
||||||
|
# typing lib
|
||||||
('from typing import cast\ncast(', {
|
('from typing import cast\ncast(', {
|
||||||
'cast(typ: object, val: Any) -> Any',
|
'cast(typ: object, val: Any) -> Any',
|
||||||
'cast(typ: str, val: Any) -> Any',
|
'cast(typ: str, val: Any) -> Any',
|
||||||
@@ -112,6 +113,7 @@ class X:
|
|||||||
('from typing import TypeVar\nTypeVar(',
|
('from typing import TypeVar\nTypeVar(',
|
||||||
'TypeVar(name: str, *constraints: Type[Any], bound: Union[None, Type[Any], str]=..., '
|
'TypeVar(name: str, *constraints: Type[Any], bound: Union[None, Type[Any], str]=..., '
|
||||||
'covariant: bool=..., contravariant: bool=...)'),
|
'covariant: bool=..., contravariant: bool=...)'),
|
||||||
|
('from typing import List\nList(', None),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
def test_tree_signature(Script, environment, code, expected):
|
def test_tree_signature(Script, environment, code, expected):
|
||||||
|
|||||||
Reference in New Issue
Block a user