[Python-Dev] Classes and Metaclasses in Smalltalk
Guido van Rossum
guido@digicool.com
Wed, 02 May 2001 10:19:07 -0500
> Here's an implementation of what I currently use to track down
> the basemethod (taken from mx.Tools):
How am I supposed to use this?
I tried this:
class B:
def foo(self):
print "B.foo"
class C(B):
def foo(self):
print "C.foo"
B.foo(self)
print basemethod(self.foo) # Expect this to be B.foo
class D(C):
def foo(self):
print "D.foo"
C.foo(self)
d = D()
d.foo()
but the call to basemethod(self.foo) in C prints C.foo, not B.foo as
required.
--Guido van Rossum (home page: http://www.python.org/~guido/)