mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 02:27:06 +08:00
Add test which demonstrates incomplete generic Callable handling
This commit is contained in:
@@ -80,6 +80,7 @@ for c2, in list_t_to_list_tuple_t(list_of_ints):
|
|||||||
c2
|
c2
|
||||||
|
|
||||||
|
|
||||||
|
# Test handling of nested callables
|
||||||
def foo(x: int) -> int:
|
def foo(x: int) -> int:
|
||||||
return x
|
return x
|
||||||
|
|
||||||
@@ -99,6 +100,21 @@ for b in list_func_t_to_list_func_type_t(list_of_funcs):
|
|||||||
b(int)
|
b(int)
|
||||||
|
|
||||||
|
|
||||||
|
def bar(*a, **k) -> int:
|
||||||
|
return len(a) + len(k)
|
||||||
|
|
||||||
|
|
||||||
|
list_of_funcs_2 = [bar] # type: List[Callable[..., int]]
|
||||||
|
|
||||||
|
def list_func_t_passthrough(the_list: List[Callable[..., T]]) -> List[Callable[..., T]]:
|
||||||
|
return the_list
|
||||||
|
|
||||||
|
|
||||||
|
for b in list_func_t_passthrough(list_of_funcs_2):
|
||||||
|
#? int()
|
||||||
|
b(None, x="x")
|
||||||
|
|
||||||
|
|
||||||
mapping_int_str = {42: 'a'} # type: Dict[int, str]
|
mapping_int_str = {42: 'a'} # type: Dict[int, str]
|
||||||
|
|
||||||
# Test that mappings (that have more than one parameter) are handled
|
# Test that mappings (that have more than one parameter) are handled
|
||||||
|
|||||||
Reference in New Issue
Block a user