Terry Reedy <[EMAIL PROTECTED]> wrote:
   ...
> As was once pointed out to me some years ago, when I wrote something 
> similar, a.f() is not just a shortcut for A.f(a) [a.__class__.f(a)].   The
> latter only looks for f in the class A namespace while the former also
> looks in superclass namespaces.

Nope:

>>> class B:
...   def f(self): print 'b.f'
... 
>>> class A(B): pass
... 
>>> a=A()
>>> a.__class__.f(a)
b.f
>>>

Inheritance applies in any lookup of an attribute in a class, just as
well as on an instance of the class.

Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to