François Durand <fradurand...@gmail.com> added the comment: 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 . ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39274> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com