Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import abc
- class Dog(metaclass=abc.ABCMeta):
- @abc.abstractmethod
- def eat_shit(self):
- return NotImplemented
- @abc.abstractmethod
- def pee(self):
- return NotImplemented
- class Shiba(Dog):
- def eat_shit(self):
- print("I'm eating shit".format())
- def pee(self):
- print("I'm peeing........")
- Shiba().eat_shit()
- # Result > I'm eating shit
- Shiba().pee()
- # Result > I'm peeing........
Add Comment
Please, Sign In to add comment