Created
October 17, 2018 15:44
-
-
Save JackInTaiwan/cab4777d83cd2324241c7b26a1e52093 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
class Dog(metaclass=abc.ABCMeta): | |
@abc.abstractmethod | |
def eat_shit(self): | |
return NotImplemented | |
class Shiba(Dog): | |
pass | |
Shiba() | |
# Error > TypeError: Can't instantiate abstract class Shiba with abstract methods eat_shit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment