]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-153200: Fix math.isqrt() for int subclasses with overridden comparison...
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 6 Jul 2026 18:46:04 +0000 (21:46 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 18:46:04 +0000 (18:46 +0000)
commita9a91d06a0e1faad9a56d4e652e4a7a98033adf8
tree1c0c73c82f5314aa317a877f19d151cd59c24e73
parentd87ee02499dd8a5d7fac7a03ba310abb7d78d2a2
[3.14] gh-153200: Fix math.isqrt() for int subclasses with overridden comparison operators (GH-153203) (GH-153225)

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.

(cherry picked from commit 3a1b5473f217fc493f743c9ca8b877d2e76f8e6b)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Lib/test/test_math.py
Misc/NEWS.d/next/Library/2026-07-06-12-00-00.gh-issue-153200.isqrtLt.rst [new file with mode: 0644]
Modules/mathmodule.c