pythonnet icon indicating copy to clipboard operation
pythonnet copied to clipboard

Explicit float and int conversion for builtin types

Open filmor opened this issue 3 years ago • 0 comments

Fixes #1896

filmor avatar Aug 10 '22 12:08 filmor

I suggest we also add: int(System.Boolean), float(System.Boolean), and float(System.*Int*) Anything else you can think of?

lostmsu avatar Aug 10 '22 22:08 lostmsu

There are probably more valid conversions (Boolean to bool works already due to __int__), but I wouldn't want to actually change behaviour now. The implemented conversions are sensible and fix a "regression".

filmor avatar Aug 11 '22 11:08 filmor