Created
May 7, 2014 18:49
-
-
Save dirn/9251e1c9cb7643469ae6 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
class Base(object): | |
def name(self): | |
return 'Base' | |
class Subclass(Base): | |
def name(self): | |
return 'Subclass' | |
def parent_name(self): | |
return super(Subclass, self).name() | |
base = Base() | |
subclass = Subclass() | |
print base.name() | |
print subclass.name() | |
print subclass.parent_name() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment