Explicit float and int conversion for builtin types by filmor · Pull Request #1904 · pythonnet/pythonnet
I suggest we also add: int(System.Boolean), float(System.Boolean), and float(System.*Int*)
Anything else you can think of?
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".
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
deleted the
float-int-cast
branch
This was referenced
Sep 16, 2022This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters