Created
October 19, 2016 08:09
-
-
Save tomchristie/2298226901793eb38a6eed5e963144e9 to your computer and use it in GitHub Desktop.
Walks like a duck...
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 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