Created
November 9, 2010 19:17
-
-
Save gregglind/669625 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 Actor1(object): | |
def __init__(self,first,last): | |
self.first = first | |
self.last = last | |
class Actor2(Actor1): | |
def __str__(self): | |
return "%s %s %s" % (self.__class__, self.first, self.last) | |
print Actor1('John','Cusack') | |
# <__main__.Actor1 object at 0x2b77a01c7fd0> | |
print Actor2('John','Cusack') | |
<class '__main__.Actor2'> John Cusack | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment