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-boun...@lists.ironpython.com 
[mailto:users-boun...@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()
        all_kw.update(kw)
        return f(*(bind_a+a),**all_kw)
    return wrapped

ThreadStart(mypartial(foo,3)) # ok


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to