Skip to content

gh-162227: Fix scaling of format() with a format spec on the free-threading - #162360

Merged
kumaraditya303 merged 1 commit into
python:mainfrom
kumaraditya303:gh-162227-format-scaling
Nov 25, 2026
Merged

kumaraditya303 merged 1 commit into
python:mainfrom
kumaraditya303:gh-162227-format-scaling

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

…ee-threaded build

PyObject_Format() now looks up __format__ with
_PyObject_LookupSpecialMethod(), avoiding a temporary bound method
and reference count contention on the shared method object.

@asvetlov asvetlov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Minor note: there is call_special_method() in abstract.c. Maybe it's worth reusing it somehow?

@kumaraditya303
kumaraditya303 merged commit ea7b1da into python:main Nov 25, 2026
67 checks passed
@kumaraditya303
kumaraditya303 deleted the gh-162227-format-scaling branch November 25, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance or resource usage topic-free-threading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ Proxy