Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created November 9, 2010 19:17
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 gregglind/669625 to your computer and use it in GitHub Desktop.
Save gregglind/669625 to your computer and use it in GitHub Desktop.
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