ungleich-learning-circle/youngjin.han/python-the-hard-way/ex44c.py

18 lines
317 B
Python
Raw Normal View History

2020-06-17 13:25:02 +00:00
class Parent(object):
def altered(self):
print("PARENT altered()")
class Child(Parent):
def altered(self):
print("CHILD, BEFORE PARENT altered()")
super(Child, self).altered()
print("CHILD, AFTER PARENT altered()")
dad = Parent()
son = Child()
dad.altered()
son.altered()