GeezerVison is showing github.com — gh-151059: Use PyObject_CallMethodOneArg in datetime call_tzinfo_method by eendebakpt · Pull Request #151062 · python/cpython
Conversation
eendebakpt
commented
Jun 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
See corresponding issue for details.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…o_method
Call tzinfo.utcoffset()/dst() via PyObject_CallMethodOneArg with the
interned &_Py_ID(utcoffset)/&_Py_ID(dst) names instead of
PyObject_CallMethod(name, "O", arg), matching call_tzname() in the same
file. Drops the format-string parse, the temporary tuple, and the
per-call method-name string.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
eendebakpt
changed the title
gh-150942: Use PyObject_CallMethodOneArg in datetime call_tzinfo_method
gh-151059: Use PyObject_CallMethodOneArg in datetime call_tzinfo_method
Jun 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
sobolevn
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you! I am wondering if there are other similar cases 🤔
I'll have a look!
No backports, since this is a new perf feature :)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
I wanted to give Paul a few days in case he wants to comment, but this is a small change so there's not much to discuss ;-)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Awesome! Thank you! I am wondering if there are other similar cases 🤔
I'll have a look! No backports, since this is a new perf feature :)
Yes, many. But most not with the same obvious performance impact. I can create a mechanical change for them, but it might be rejected as churn.
|
StanFromIreland reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Please, provide perf metrics, so we can decide :)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Please, provide perf metrics, so we can decide :)
I created #151157 as a general improvement. For conversions to PyObject_CallMethodOneArg I'll benchmark (but I suspect not many cases are left)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
sobolevn
sobolevn approved these changes
pganssle
Awaiting requested review from pganssle
pganssle is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|