ungleich-learning-circle/kjg/python-the-hard-way/e44c.py
2020-06-17 22:48:58 +09:00

16 lines
332 B
Python

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()