[IronPython] Special method lookup

Sanghyeon Seo sanxiyn at gmail.com
Wed May 24 12:02:33 CEST 2006


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...

# test.py
class Strange(object):
    pass

obj = Strange()
obj.__nonzero__ = lambda: False
print obj.__nonzero__()
print bool(obj)

# CPython
False
True

# IronPython
False
False

Seo Sanghyeon



More information about the Ironpython-users mailing list