[IronPython] result of partial is not callable

Dino Viehland dinov at microsoft.com
Mon Mar 15 18:34:01 CET 2010

Definitely a bug, and I don't think it's fixed in 2.6.1.  I've opened http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26482  And there's more that needs to be done - they're not currently callable from Ruby either.

Thanks for reporting this.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor
Sent: Saturday, March 13, 2010 11:08 AM
To: Discussion of IronPython
Subject: [IronPython] result of partial is not callable

I got this problem with 2.6.0. Haven't tried on 2.6.1

from System.Threading import ThreadStart
from functools import partial
def foo(x): pass

ThreadStart(partial(foo,3)) # TypeError: Object is not callable

def mypartial(f,*bind_a,**bind_kw):
    def wrapped(*a,**kw):
        all_kw = bind_kw.copy()
        return f(*(bind_a+a),**all_kw)
    return wrapped

ThreadStart(mypartial(foo,3)) # ok

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100315/a5a524c2/attachment.html>

More information about the Ironpython-users mailing list