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-161694: [C API] Add PyTupleWriter API by vstinner · Pull Request #161639 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Nov 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Add _PyTuple_ResizeKeepOnError(). It copies the tuple
when shrinking the tuple to leave the tuple unchanged on error.

  • Issue: [C API] Add PyTupleWriter API #161694

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner
vstinner force-pushed the tuplewriter branch from bccb8b8 to e58f319 Compare November 8, 2026 20:20
@read-the-docs-community

read-the-docs-community Bot commented Nov 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35770548 | 📁 Comparing 6bf33a8 against main (eba2a21)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

  • builtins/functions.html
  • builtins/stdtypes.html
  • c-api/tuple.html
  • faq/library.html
  • library/pdb.html
  • whatsnew/3.16.html
  • whatsnew/changelog.html
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner force-pushed the tuplewriter branch 2 times, most recently from 9796499 to 0f28d27 Compare November 8, 2026 20:25
@vstinner

vstinner commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Oh. There are some legit test failures. Example:

test_structseq_newtype_null_descr_doc (test.test_capi.test_misc.Test_testcapi.test_structseq_newtype_null_descr_doc) ... python: ../cpython-ro-srcdir/Include/internal/pycore_tuple.h:119: _PyTupleWriter_CheckConsistency: Assertion `Py_REFCNT(tuple) == 1' failed.
Fatal Python error: Aborted

Current thread 0x000075e4dba4f780 [python] (most recent call first):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/unittest/case.py", line 637 in _callTestMethod
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner force-pushed the tuplewriter branch 2 times, most recently from 7d44c78 to d61541f Compare November 9, 2026 17:36
@vstinner
WIP: [C API] Add PyTupleWriter API
ca682bb
@vstinner
vstinner force-pushed the tuplewriter branch from d61541f to ca682bb Compare November 9, 2026 17:50
@vstinner vstinner changed the title [C API] Add PyTupleWriter API gh-161694: [C API] Add PyTupleWriter API Nov 9, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Nov 9, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Nov 9, 2026
[C API] Add PyTupleWriter API #161694
Open
@vstinner

vstinner commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Oh. I published this PR on cpython by mistake :-( I was trying to create a PR on my personal fork. So it seems like I have to finish the PR to make it ready for review :-D

All reactions

Sorry, something went wrong.

Uh oh!

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

vstinner added 4 commits November 9, 2026 21:39
@vstinner
Always init items to NULL
7c5b686
@vstinner
Remove duplicated PyTupleWriter_Discard() doc
4e3d94b
@vstinner
Cleanup code
234c8fd
@vstinner
Comment
6bf33a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rhettinger rhettinger Awaiting requested review from rhettinger rhettinger will be requested when the pull request is marked ready for review rhettinger is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner will be requested when the pull request is marked ready for review AA-Turner is a code owner
@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity will be requested when the pull request is marked ready for review ZeroIntensity is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

type-feature A feature request or enhancement

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.

1 participant

@vstinner
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 01402503 — 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.