[Ironpython-users] IronPython, Daily Digest 6/23/2011

2011-06-24 Thread no_reply
Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Cannot create PythonType for generic parameter which has interface constraints -- ISSUES 1. [New issue] Cannot create PythonType

[Ironpython-users] DynamicObjects.TryConvert not called in IronPython?

2011-06-24 Thread zxpatric
Hi, I am doing the similar thing as in " http://blogs.msdn.com/b/csharpfaq/archive/2009/10/19/dynamic-in-c-4-0-creating-wrappers-with-dynamicobject.aspx"; to first convert any member into an object and then expect the object.TryConvert to handle the final convert. However, what is working in C# as

Re: [Ironpython-users] DynamicObjects.TryConvert not called in IronPython?

2011-06-24 Thread Dino Viehland
In IronPython an assignment to a local/global variable will never perform a conversion. In your C# code the conversion has to happen because the variable you're assigning to is typed as double. To force the conversion you should be able to do float(obj.M1.M2.M3) or you can use the clr.Convert

Re: [Ironpython-users] DynamicObjects.TryConvert not called in IronPython?

2011-06-24 Thread zxpatric
Thanks Dino for the explanation. float(obj.M1.M2.M3) leads to Message: 'xxx' object has no attribute '__float__' clr.Convert(obj.M1.M2.M3, float) *does *work. Interesting observation: For imported .NET function C.SetFloat(float a), C.SetFloat(obj.M1.M2.M3) won't trigger the conversion as well.