Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-a9a91d0-3.13
Jul 6, 2026
Merged

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

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)
(cherry picked from commit a9a91d0)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Fable 5 noreply@anthropic.com

…ridden comparison operators (pythonGH-153203) (pythonGH-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 3a1b547)
(cherry picked from commit a9a91d06a0e1faad9a56d4e652e4a7a98033adf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 6, 2026 18:57
@serhiy-storchaka serhiy-storchaka merged commit e36fe36 into python:3.13 Jul 6, 2026
42 checks passed
@miss-islington miss-islington deleted the backport-a9a91d0-3.13 branch July 6, 2026 19:11
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