Skip to content

GH-145247: Use _PyTuple_FromPair in Modules(2) - #148003

Merged
vstinner merged 6 commits into
python:mainfrom
sergey-miryanov:feat/145247-pytuple-from-pair-use-5
Apr 2, 2026
Merged

GH-145247: Use _PyTuple_FromPair in Modules(2)#148003
vstinner merged 6 commits into
python:mainfrom
sergey-miryanov:feat/145247-pytuple-from-pair-use-5

Conversation

@sergey-miryanov

@sergey-miryanovsergey-miryanov commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Second PR for usage of the _PyTuple_FromPair[Steal] in Modules

@picnixzpicnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why two PRs for extension modules? Make it one instead please. And then you'll just wait for maintainers to acknowledge their owned part.

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

I'm OK to merge them into one PR if it's more preferable. As I answered in the first PR it is suggested by @vstinner

@picnixzpicnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok for SSL (and probably ok for posix/select/signal/socket though I'm not a codeowner).

Comment threadModules/cjkcodecs/multibytecodec.c Outdated
Comment threadModules/overlapped.c Outdated
Comment threadModules/overlapped.c Outdated
Comment threadModules/overlapped.c Outdated
Comment threadModules/posixmodule.c Outdated
sergey-miryanovand others added 3 commits April 2, 2026 22:26
Co-authored-by: Victor Stinner <vstinner@python.org>
…ey-miryanov/cpython into feat/145247-pytuple-from-pair-use-5

@StanFromIrelandStanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

datetime LGTM

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@vstinner

Copy link
Copy Markdown
Member

@picnixz:

Why two PRs for extension modules? Make it one instead please. And then you'll just wait for maintainers to acknowledge their owned part.

It's hard for me to review carefully a PR which changes too many files. So I gave an arbitrary limit of 10 files per PR.

Changes replacing PyTuple_Pack(2) with _PyTuple_FromPair() is straightforward. But changes replacing code with _PyTuple_FromPairSteal() must be carefully reviewed since it can easily introduce refleaks, bugs or crashes.

@vstinner
vstinner merged commit c1b20a6 into python:mainApr 2, 2026
52 checks passed
@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

Thanks all!

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sergey-miryanov@vstinner@picnixz@StanFromIreland