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
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
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
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.