Skip to content

Instantly share code, notes, and snippets.

@tomchristie
Created October 19, 2016 08:09
Show Gist options
  • Save tomchristie/2298226901793eb38a6eed5e963144e9 to your computer and use it in GitHub Desktop.
Save tomchristie/2298226901793eb38a6eed5e963144e9 to your computer and use it in GitHub Desktop.
Walks like a duck...
class Duck(object):
def walk(self):
print('waddle')
def talk(self):
print('quack')
class Donald(object):
def walk(self):
print('waddle')
def talk(self):
print('quack')
def do_ducky_things(duck: Duck):
duck.walk()
duck.talk()
donald = Donald()
do_ducky_things(donald)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment