Skip to content

gh-142518: add thread safety annotations for tuple C-API#148012

Open
kumaraditya303 wants to merge 5 commits intopython:mainfrom
kumaraditya303:tuple-capi
Open

gh-142518: add thread safety annotations for tuple C-API#148012
kumaraditya303 wants to merge 5 commits intopython:mainfrom
kumaraditya303:tuple-capi

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 commented Apr 2, 2026

Copy link
Copy Markdown
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Isn't PyTuple_SetItem thread-safe on an "existing" tuple if the tuple is uniquely referenced?

Comment on lines +102 to +103
and set an :exc:`IndexError` exception. This function should only be used to fill in brand new tuples;
using it on an existing tuples is thread-unsafe.
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.

Small typo:

Suggested change
and set an :exc:`IndexError` exception. This function should only be used to fill in brand new tuples;
using it on an existing tuples is thread-unsafe.
and set an :exc:`IndexError` exception. This function should only be used to fill in brand new tuples;
using it on an existing tuple is thread-unsafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants