multiple inheritance

newseater kbilsted at hotmail.com
Thu Jun 9 04:27:47 EDT 2005


if I only use the super() construct it seems not to call B




class A(object):
	def foo(self):
		print "a"

class B(object):
	def foo(self):
		print "b"

class C(A,B):
	def foo(self):
		print "c"
		super(C,self).foo()


c = C()

produces
c
a




oddly i can produce a "b" by using

super(A,self).foo()

i'm not sure why it isn't super(B,self).foo()




More information about the Python-list mailing list