Make this test case obey typing rules in Python

Unfortunately I can't recall exactly what it was that this test
case was trying to validate, however on a second look it turns
out that it was working by accident and did not represent a valid
use of generic type vars in Python (which cannot be used completely
unbound as this was).
This commit is contained in:
Peter Law
2020-04-18 22:56:46 +01:00
parent 1c4a2edbdb
commit 7ebbf9da44

View File

@@ -80,11 +80,11 @@ for c2, in list_t_to_list_tuple_t(list_of_ints):
c2
def foo(x: T) -> T:
def foo(x: int) -> int:
return x
list_of_funcs = [foo] # type: List[Callable[[T], T]]
list_of_funcs = [foo] # type: List[Callable[[int], int]]
def list_func_t_to_list_func_type_t(the_list: List[Callable[[T], T]]) -> List[Callable[[Type[T]], T]]:
def adapt(func: Callable[[T], T]) -> Callable[[Type[T]], T]: