GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-151059: Use PyObject_CallMethodOneArg in datetime call_tzinfo_method by eendebakpt · Pull Request #151062 · python/cpython

Conversation

@eendebakpt

@eendebakpt eendebakpt commented Jun 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See corresponding issue for details.

  • Issue: Use PyObject_CallMethodOneArg in datetime call_tzinfo_method #151059

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@eendebakpt @claude
pythongh-151059: Use PyObject_CallMethodOneArg in datetime call_tzinf…
26d5647
…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
eendebakpt requested review from StanFromIreland and pganssle as code owners June 7, 2026 20:25
@bedevere-app bedevere-app Bot added the awaiting review label Jun 7, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 7, 2026
Improve performance by using reference stealing methods #150942
Open
@eendebakpt 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
@bedevere-app bedevere-app Bot mentioned this pull request Jun 7, 2026
Use PyObject_CallMethodOneArg in datetime call_tzinfo_method #151059
Closed
@StanFromIreland StanFromIreland added the skip news label Jun 8, 2026
StanFromIreland
StanFromIreland approved these changes Jun 8, 2026
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 8, 2026
sobolevn
sobolevn approved these changes Jun 8, 2026
View reviewed changes

@sobolevn sobolevn left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@sobolevn
sobolevn merged commit 537702d into python:main Jun 8, 2026
60 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 8, 2026
@StanFromIreland

StanFromIreland commented Jun 8, 2026

Copy link
Copy Markdown
Member

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 ;-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eendebakpt

eendebakpt commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Jun 8, 2026

Copy link
Copy Markdown
Member

Please, provide perf metrics, so we can decide :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eendebakpt

eendebakpt commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

philthompson10 pushed a commit to philthompson10/cpython that referenced this pull request Jun 17, 2026
@eendebakpt @philthompson10
pythongh-151059: [perf] Use PyObject_CallMethodOneArg in datetime's…
37f9353
… `call_tzinfo_method` (python#151062)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn approved these changes
@StanFromIreland StanFromIreland StanFromIreland approved these changes
@pganssle 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

Labels

skip news

Projects

None yet

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.

3 participants

@eendebakpt @StanFromIreland @sobolevn
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.