Skip to content

[3.15] gh-153200: Fix math.isqrt() for int subclasses with overridden comparison operators (GH-153203)#153223

Merged
serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-3a1b547-3.15
Jul 6, 2026
Merged

[3.15] gh-153200: Fix math.isqrt() for int subclasses with overridden comparison operators (GH-153203)#153223
serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-3a1b547-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 3a1b547)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…comparison operators (pythonGH-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.
(cherry picked from commit 3a1b5473f217fc493f743c9ca8b877d2e76f8e6b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 6, 2026 18:13
@serhiy-storchaka serhiy-storchaka merged commit cca9d1c into python:3.15 Jul 6, 2026
98 of 100 checks passed
@miss-islington miss-islington deleted the backport-3a1b547-3.15 branch July 6, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants