SHARE
TWEET

Untitled

a guest Jul 4th, 2015 259 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top