[IronPython] Builtin functions are never bound

Dino Viehland dinov at exchange.microsoft.com
Tue Feb 7 17:47:24 CET 2006


Thanks for the bug report - we actually still have a little cleanup to do in the area of built-in functions, but it's great to have this one extra edge case on the radar before we get there.  I've filed the bug in our database but I'm not entirely sure when we'll get to this one, but hopefully soon.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo
Sent: Tuesday, February 07, 2006 3:02 AM
To: Discussion of IronPython
Subject: [IronPython] Builtin functions are never bound

In CPython, there is an assumption that builtin functions are never
bound. What an obscure stuff. Hopefully an example would clarify this.

# ex.py
class C:
    method = cmp
c = C()
print c.method(1, 1)

$ python ex.py
0
$ ip ex.py
Traceback (most recent call last):
  File __main__, line unknown, in Initialize
TypeError: cmp() takes exactly 2 arguments (3 given)

PyPy has suffered this too:
http://codespeak.net/pipermail/pypy-svn/2005-May/004905.html

Standard library modules like optparse and unittest are known to rely
on this. I don't like this quirk at all, but perhaps you want to know
these stuffs...

Seo Sanghyeon
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list