[IronPython] result of partial is not callable

Ronnie Maor ronnie.maor at gmail.com
Sat Mar 13 20:07:47 CET 2010

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/20100313/679fcae7/attachment.html>

More information about the Ironpython-users mailing list