MixIn method to call the method it overrides: how?

wittempj@hotmail.com martin.witte at gmail.com
Sat Jun 18 16:30:46 CEST 2005


Something like this will do what you want to achieve. I think the above
does as well what you want, but to me my solution is much more clear

class Base(object):
	def foo(self):
		print 'Base foo'

class Derived(Base):
	def foo(self):
		super(Derived, self).foo()
		print 'Derived foo'
d = Derived()
d.foo()




More information about the Python-list mailing list