ironpython3
ironpython3 copied to clipboard
Add support for e format in _struct
See https://docs.python.org/3/whatsnew/3.6.html#struct
https://github.com/IronLanguages/ironpython3/pull/1457 adds support to .NET 6.0 (via System.Half).
#1457 adds support to .NET 6.0 (via
System.Half).
I wonder what Half will do to the overload resolution rules...
Also I see Half supported from .NET 5 up. Does it mean we do not support net5.0 anymore?
#1457 adds support to .NET 6.0 (via
System.Half).I wonder what
Halfwill do to the overload resolution rules...
I'm not sure if it'll impact overload resolution. I think it's just a struct with explicit casts to/from floats.
Also I see
Halfsupported from .NET 5 up. Does it mean we do not supportnet5.0anymore?
.NET 5 doesn't have the BitConverter overloads to go to/from bytes. But yes, we can remove it and save a bit of CI time (though I need to look at .NET 7 again).
I'm not sure if it'll impact overload resolution.
Just tested a bit by hacking BinderTest. Overloads using Half are not accepting any numeric values (float or otherwise). Also, I cannot create any instances of Half (except zero). I suppose it need to be added to FloatOps. Maybe it is worth a separate Issue?
I'm not sure if it'll impact overload resolution.
Just tested a bit by hacking
BinderTest. Overloads usingHalfare not accepting any numeric values (float or otherwise). Also, I cannot create any instances ofHalf(except zero). I suppose it need to be added toFloatOps. Maybe it is worth a separate Issue?
Right, but I don't think C# has language support either, the only(?) way to get a non-zero Half is by casting, for example you can't write Half.IsNaN(1.0), has to be Half.IsNaN((Half)1.0). As for creating instances in IronPython I think you can do a cast like this: clr.Convert(1.2, System.Half). We could potentially add a convenience constructor like we do for other numeric types but that is indeed a separate issue (or just a PR).
As for creating instances in IronPython I think you can do a cast like this:
clr.Convert(1.2, System.Half). We could potentially add a convenience constructor like we do for other numeric types but that is indeed a separate issue (or just a PR).
OK, clr.Convert works for me.