Created
July 10, 2020 04:32
-
-
Save tiffany352/c84e0bf59997bcf7429b276335eb681e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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