2015-05-18 23:05:20 -07:00
|
|
|
|
#: staticchecking/DogsAndRobots.py
|
2015-05-29 14:18:51 -07:00
|
|
|
|
# <20>2015 MindView LLC: see Copyright.txt
|
2015-05-18 23:05:20 -07:00
|
|
|
|
|
|
|
|
|
def speak(anything):
|
|
|
|
|
anything.talk()
|
|
|
|
|
|
|
|
|
|
class Dog:
|
|
|
|
|
def talk(self): print("Arf!")
|
|
|
|
|
def reproduce(self): pass
|
|
|
|
|
|
|
|
|
|
class Robot:
|
|
|
|
|
def talk(self): print("Click!")
|
|
|
|
|
def oilChange(self): pass
|
|
|
|
|
|
|
|
|
|
a = Dog()
|
|
|
|
|
b = Robot()
|
|
|
|
|
|
|
|
|
|
speak(a)
|
|
|
|
|
speak(b)
|
|
|
|
|
#:~
|