disambiguation in Python multiple inheritance

Skip Montanaro (montnaro@ausable.crd.ge.com)
Tue, 21 Jun 1994 14:29:37 GMT

Consider the following simple Python multiple inheritance example:

class base1:
def foo(self):
print 'base1.foo'

class base2:
def foo(self):
print 'base2.foo'

class derived(base1, base2):
def tst(self):
self.foo()
base2.foo(self)

It's clear that this works, but is there a way to call base2.foo() that
makes it look more like a base class attribute is being called, e.g.,
something that doesn't require the explicit 'self' argument in the call to
base2.foo()? (I realize this is a minor point. Don't everyone get all worked
up about it. I'm not trying to change Python into C++. I'm just curious. :-)

Thx,

--
Skip Montanaro (montanaro@ausable.crd.ge.com)
Now working for Automatrix - "World-Wide Computing Solutions"