from typing import _T as T, Callable, Generic, TypeVar class A(Generic[T]): def f(self) -> None: ... c: Callable[[A[int]], None] c = A.f c = A[int].f # error: Incompatible types in assignment (expression has type "(A[T]) -> None", variable has type "(A[int]) -> None")
expression has type "(A[T]) -> None"
Uhhhh, I don't think it does...
class B(A[int]): ... # some higher order method foo(list_of_b, B.f) # error
Use checkmember.py to check protocol subtyping (python#18943)
Activity
Use checkmember.py to check protocol subtyping (python#18943)
Use checkmember.py to check protocol subtyping (python#18943)