Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. >>> import abc
  2. >>> class Shape(metaclass=abc.ABCMeta):
  3. ...     @abc.abstractmethod
  4. ...     def method_to_implement(self, input):
  5. ...         return
  6. ...
  7. >>> class Foo(Shape):
  8. ...     pass
  9. ...
  10. >>> foo = Foo()
  11. Traceback (most recent call last):
  12.   File "<stdin>", line 1, in <module>
  13. TypeError: Can't instantiate abstract class Foo with abstract methods method_to_implement
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement