]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-153200: Fix math.isqrt() for int subclasses with overridden comparison operators...
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 6 Jul 2026 18:10:23 +0000 (21:10 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 18:10:23 +0000 (21:10 +0300)
commit3a1b5473f217fc493f743c9ca8b877d2e76f8e6b
treee5dd3d6a1acda2a03260963200c9d667c2131daa
parent53661afabd2b4a9c92230ee7024dc42782164f8e
gh-153200: Fix math.isqrt() for int subclasses with overridden comparison operators (GH-153203)

The final check-and-correct comparison in the arbitrary precision path
could call a comparison operator overridden in an int subclass.
Compare by value with int's tp_richcompare.
Lib/test/test_math_integer.py
Misc/NEWS.d/next/Library/2026-07-06-12-00-00.gh-issue-153200.isqrtLt.rst [new file with mode: 0644]
Modules/mathintegermodule.c