Skip to content

Instantly share code, notes, and snippets.

@seanrclayton
Created November 21, 2014 22:31
Show Gist options
  • Save seanrclayton/cb8c6b50b69fa5beeb12 to your computer and use it in GitHub Desktop.
Save seanrclayton/cb8c6b50b69fa5beeb12 to your computer and use it in GitHub Desktop.
class Employee(object):
def __init__(self, name):
self.name = name
def greet(self, other):
print "Hello, %s" % other.name
class CEO(Employee):
def greet(self, other):
print "Get back to work, %s!" % other.name
ceo = CEO("Emily")
emp = Employee("Steve")
emp.greet(ceo)
# Hello, Emily
ceo.greet(emp)
# Get back to work, Steve!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment