[IronPython] Fwd: Ironpython delegates...

Dino Viehland dinov at microsoft.com
Fri Feb 27 23:10:53 CET 2009

Any delegate should work for this so I'd suggest Func<object> instead.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Antonio Piteira
Sent: Thursday, February 26, 2009 2:10 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Fwd: Ironpython delegates...

Hi Dino,

Thanks for your reply...

I had to synchronize threads in order to avoid cross-threading operations. I have Ironpython hosted on an aplication with plugins, every time I accessed some form control ( Plugin Form Designer ) I got a cross-thread error, so I needed to invoke that instance.
CallTarget solved my problem... Do you know any other methodology that works better then CallTarget?

Thank you,
António Piteira

2009/2/22 Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>>

Depending on what you're doing you might be better off using Func<object> instead of CallTarget0.  CallTarget0 is more of a Python implementation detail and could change w/ major IronPython versions - or even be replaced w/ Func<object>.  it's primary purpose is to be the delegate for calling a zero-arg Python function so it could change due to changes in how we implement functions.  Func<object> will always exist and do exactly what it says.  Of course if you are actually doing something w/ calling classes or functions then it's the right thing to use.

From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Antonio Piteira
Sent: Sunday, February 22, 2009 10:26 AM
To: users at lists.ironpython.com<mailto:users at lists.ironpython.com>
Subject: [IronPython] Fwd: Ironpython delegates...

Found the solution...


from IronPython.Compiler import CallTarget0

I was looking in the wrong place.


I've been searching for CallTarget0 and from what I read it should be in Microsoft.Scripting.dll, but when I add the reference to clr and import CallTarget0  from Microsoft.Scripting.dll I get this message:




Cannot import name CallTarget0




Any ideas?

Thank you.

Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>

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

More information about the Ironpython-users mailing list