Message359673
As of now, fractions.Fraction.__bool__ is implemented as: ``return a._numerator != 0``. However, this does not necessary return a bool (which would be desired). In particular, when the numerator is a numpy integer, this returns a numpy bool instead. Another solution would be to implement fractions.Fraction.__bool__ as: ``return bool(numerator)``. What do you think?
This message follows a thread here: https://github.com/numpy/numpy/issues/15277 . |
|
Date |
User |
Action |
Args |
2020-01-09 12:43:51 | francois-durand | set | recipients:
+ francois-durand |
2020-01-09 12:43:51 | francois-durand | set | messageid: <1578573831.64.0.0454191861618.issue39274@roundup.psfhosted.org> |
2020-01-09 12:43:51 | francois-durand | link | issue39274 messages |
2020-01-09 12:43:51 | francois-durand | create | |
|