mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Generics don't have signatures
This commit is contained in:
@@ -146,6 +146,9 @@ class DefineGenericBaseClass(LazyValueWrapper):
|
|||||||
) for class_set1, class_set2 in zip(given_params1, given_params2)
|
) for class_set1, class_set2 in zip(given_params1, given_params2)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_signatures(self):
|
||||||
|
return []
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s: %s%s>' % (
|
return '<%s: %s%s>' % (
|
||||||
self.__class__.__name__,
|
self.__class__.__name__,
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ class X:
|
|||||||
'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),
|
('from typing import List\nList(', None),
|
||||||
|
('from typing import List\nList[int](', None),
|
||||||
|
('from typing import Tuple\nTuple(', None),
|
||||||
|
('from typing import Tuple\nTuple[int](', None),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
def test_tree_signature(Script, environment, code, expected):
|
def test_tree_signature(Script, environment, code, expected):
|
||||||
@@ -148,7 +151,7 @@ def test_tree_signature(Script, environment, code, expected):
|
|||||||
('full_redirect(C)', 'z, *, c'),
|
('full_redirect(C)', 'z, *, c'),
|
||||||
('full_redirect(C())', 'y'),
|
('full_redirect(C())', 'y'),
|
||||||
('full_redirect(G)', 't: T'),
|
('full_redirect(G)', 't: T'),
|
||||||
('full_redirect(G[str])', 't: T'),
|
('full_redirect(G[str])', '*args, **kwargs'),
|
||||||
('D', 'D(a, z, /)'),
|
('D', 'D(a, z, /)'),
|
||||||
('D()', 'D(x, y)'),
|
('D()', 'D(x, y)'),
|
||||||
('D().foo', 'foo(a, *, bar, z, **kwargs)'),
|
('D().foo', 'foo(a, *, bar, z, **kwargs)'),
|
||||||
|
|||||||
Reference in New Issue
Block a user