Skip to content

Instantly share code, notes, and snippets.

@JackInTaiwan
Created October 17, 2018 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JackInTaiwan/cab4777d83cd2324241c7b26a1e52093 to your computer and use it in GitHub Desktop.
Save JackInTaiwan/cab4777d83cd2324241c7b26a1e52093 to your computer and use it in GitHub Desktop.
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