Skip to content

Instantly share code, notes, and snippets.

@tomchristie tomchristie/duck.py
Created Oct 19, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.