Message359674
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(a._numerator)``. What do you think?
This message follows a thread here: https://github.com/numpy/numpy/issues/15277 . |
|
Date |
User |
Action |
Args |
2020-01-11 01:11:53 | terry.reedy | unlink | issue39274 messages |
2020-01-09 12:45:17 | francois-durand | set | recipients:
+ francois-durand |
2020-01-09 12:45:17 | francois-durand | set | messageid: <1578573917.71.0.0904997075632.issue39274@roundup.psfhosted.org> |
2020-01-09 12:45:17 | francois-durand | link | issue39274 messages |
2020-01-09 12:45:17 | francois-durand | create | |
|