gh-128426: Mention PySequence_Fast in free-threading C API HOWTO (#128428)

This commit is contained in:
Nathan Goldbaum 2025-01-03 00:40:24 -07:00 committed by GitHub
parent 8eebe4e6d0
commit e7adeecc2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,8 +96,10 @@ Most of the C API is thread-safe, but there are some exceptions.
* **Struct Fields**: Accessing fields in Python C API objects or structs * **Struct Fields**: Accessing fields in Python C API objects or structs
directly is not thread-safe if the field may be concurrently modified. directly is not thread-safe if the field may be concurrently modified.
* **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM` and * **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`,
:c:macro:`PyList_SET_ITEM` do not perform any error checking or locking. :c:macro:`PyList_SET_ITEM`, and macros like
:c:macro:`PySequence_Fast_GET_SIZE` that use the object returned by
:c:func:`PySequence_Fast` do not perform any error checking or locking.
These macros are not thread-safe if the container object may be modified These macros are not thread-safe if the container object may be modified
concurrently. concurrently.
* **Borrowed References**: C API functions that return * **Borrowed References**: C API functions that return