This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author francois-durand
Recipients francois-durand
Date 2020-01-09.12:45:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578573917.71.0.0904997075632.issue39274@roundup.psfhosted.org>
In-reply-to
Content
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 .
History
Date User Action Args
2020-01-11 01:11:53terry.reedyunlinkissue39274 messages
2020-01-09 12:45:17francois-durandsetrecipients: + francois-durand
2020-01-09 12:45:17francois-durandsetmessageid: <1578573917.71.0.0904997075632.issue39274@roundup.psfhosted.org>
2020-01-09 12:45:17francois-durandlinkissue39274 messages
2020-01-09 12:45:17francois-durandcreate