Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. from typing import Generic, TypeVar, Tuple
  2.  
  3. class X: pass
  4. class Y(X): pass
  5. class Z: pass
  6.  
  7. T = TypeVar('T', bound=X)
  8.  
  9. class A(Generic[T]):
  10. def f(self, x: T) -> None: pass
  11.  
  12. class B(A[Y]):
  13. def f(self, x: Y) -> None: pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement