]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)
authorSebastian Berg <sebastian@sipsolutions.net>
Thu, 6 Feb 2020 14:54:05 +0000 (06:54 -0800)
committerGitHub <noreply@github.com>
Thu, 6 Feb 2020 14:54:05 +0000 (15:54 +0100)
commit427c84f13f7719e6014a21bd1b81efdc02a046fb
tree10bf00b3c7211b2581887ee3e07c2baca3b8cb07
parent3f563cea567fbfed9db539ecbbacfee2d86f7735
bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)

Some numerator types used (specifically NumPy) decides to not
return a Python boolean for the "a != b" operation. Using the equivalent
call to bool() guarantees a bool return also for such types.
Lib/fractions.py
Lib/test/test_fractions.py
Misc/NEWS.d/next/Library/2020-01-15-23-13-03.bpo-39274.lpc0-n.rst [new file with mode: 0644]