Advertisement
roachsinai

Untitled

Mar 30th, 2022
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from abc import abstractproperty
  2.  
  3. from typing import Generic, TypeVar
  4.  
  5. T_co = TypeVar('T_co', covariant=True)
  6. T = TypeVar('T')
  7.  
  8. class Dataset(Generic[T_co]):
  9.     def __getitem__(self, index) -> T_co:
  10.         raise NotImplementedError
  11.  
  12.  
  13. class Base(Dataset):
  14.     @abstractproperty
  15.     def num_joints(self):
  16.         return None
  17.  
  18. class Derived(Base):
  19.     def t(self):
  20.         pass
  21.  
  22. d = Derived()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement