Skip to content

Instantly share code, notes, and snippets.

@tiffany352
Created July 10, 2020 04:32
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 tiffany352/c84e0bf59997bcf7429b276335eb681e to your computer and use it in GitHub Desktop.
Save tiffany352/c84e0bf59997bcf7429b276335eb681e to your computer and use it in GitHub Desktop.
class Item:
def print(self):
print(self.getText())
def getText(self):
return "foo"
class SpecialItem:
def print(self):
print("SpecialItem: " + self.getText())
class WithText(Item):
def getText(self):
return "custom text"
class MyItem(SpecialItem, WithText):
pass
item = MyItem()
item.print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment