Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. from abc import ABCMeta, abstractmethod
  2.  
  3. class BaseABC(object):
  4. __metaclass__ = ABCMeta
  5.  
  6. @abstractmethod
  7. def __init__(self, *args, **kwargs):
  8. pass
  9.  
  10. @abstractmethod
  11. def foo(self):
  12. pass
  13.  
  14.  
  15. class Subclass(BaseABC):
  16.  
  17. def __init__(self):
  18. print('poop')
  19.  
  20. def foo(self):
  21. pass
  22.  
  23. assert issubclass(Subclass, BaseABC)
  24.  
  25. def main():
  26. sc = Subclass('testing')
  27.  
  28.  
  29. if __name__ == "__main__":
  30. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement