Skip to content

Instantly share code, notes, and snippets.

@farhaanbukhsh
Last active July 21, 2018 15:19
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 farhaanbukhsh/bf053d34a0b94008a915af68ce804f8e to your computer and use it in GitHub Desktop.
Save farhaanbukhsh/bf053d34a0b94008a915af68ce804f8e to your computer and use it in GitHub Desktop.
from abc import ABC, abstractmethod
class BuffetHogger(ABC):
@abstractmethod
def starter_hogging(self):
pass
@abstractmethod
def main_course_hogging(self):
pass
@abstractmethod
def dessert_hogging(self):
pass
def template_hogging(self):
self.starter_hogging()
self.main_course_hogging()
self.dessert_hogging()
class Farhaan(BuffetHogger):
def starter_hogging(self):
print("Eat Chicken Tikka")
print("Eat Kalmi Kebab")
def __call__(self):
self.template_hogging()
def main_course_hogging(self):
print("Eat Biryani")
def dessert_hogging(self):
print("Eat Phirni")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment