Kent Johnson [EMAIL PROTECTED] writes:
Leif K-Brooks wrote:
New-style classes look up special methods on the class, not on the instance:
For my future reference, is this documented somewhere in the standard docs?
Maybe somewhere in here :-(
http://www.python.org/doc/newstyle.html
John
Kent Johnson wrote:
Leif K-Brooks wrote:
New-style classes look up special methods on the class, not on the instance:
For my future reference, is this documented somewhere in the standard docs?
Looks like it's the most detailed explanation on the net:
John J. Lee wrote:
Kent Johnson [EMAIL PROTECTED] writes:
Leif K-Brooks wrote:
New-style classes look up special methods on the class, not on the instance:
For my future reference, is this documented somewhere in the standard docs?
Maybe somewhere in here :-(
I am learning about metaclasses and there is something that confuses me.
I understand that if I define a __call__ method for a class, then instances of
the class become callable using function syntax:
class Foo(object):
... def __call__(self):
... print 'Called Foo'
...
f=Foo()
Kent Johnson wrote:
But why doesn't Foo.__call__ shadow type.__call__? Normally an instance
attribute takes precedence over a class attribute. Is it something
special about how function call syntax is handled internally, or do all
special methods work this way, or is there something else going
Leif K-Brooks wrote:
New-style classes look up special methods on the class, not on the instance:
For my future reference, is this documented somewhere in the standard docs?
Thanks,
Kent
--
http://mail.python.org/mailman/listinfo/python-list