[IronPython] Special method lookup

Sanghyeon Seo sanxiyn at gmail.com
Wed May 24 12:11:30 CEST 2006


2006/5/24, Sanghyeon Seo <sanxiyn at gmail.com>:
> Obscure. The issue is that special method lookup should only happen on
> the type, not the instance. I am not sure whether this is clearly
> specified...

Python Reference Manual 3.3. The wording is not the best. Should file a doc bug.

"For instance, if a class defines a method named __getitem__(), and x
is an instance of this class, then x[i] is equivalent to
x.__getitem__(i)."

In this case, although x.__getitem__ exists, x is an instance of a
class which *does not* define a method named __getitem__(), so it
should not be called.

Seo Sanghyeon



More information about the Ironpython-users mailing list