t239.py 293 B

123456789101112131415161718
  1. class Base(object):
  2. def myfunc(self):
  3. print "Base.myfunc"
  4. def stuff(self):
  5. print "Base.stuff"
  6. self.myfunc()
  7. class Derived(Base):
  8. def myfunc(self):
  9. Base.myfunc(self)
  10. print "Derived.myfunc"
  11. d = Derived()
  12. d.myfunc()
  13. b = Derived()
  14. b.stuff()