Explicit float and int conversion for builtin types by filmor · Pull Request #1904 · pythonnet/pythonnet

@filmor

@filmor

@lostmsu

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

@filmor

@filmor

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

lostmsu

@filmor

lostmsu

lostmsu

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about new tests

@filmor filmor deleted the float-int-cast branch

August 12, 2022 04:07

This was referenced

Sep 16, 2022