Skip to content

Commit 0e89d37

Browse files
authored
Update documentation on PyObject opaqueness and module init
Clarified access restrictions on PyObject members and recommended functions for type and reference count manipulation.
1 parent 367ef68 commit 0e89d37

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Doc/howto/freethreading-stable-abi.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ You can use it to enable code that only runs under the free-threaded build::
2929
can be used to determine whether the current running interpreter had the
3030
macro defined.
3131

32+
`PyObject` opaqueness
33+
=====================
34+
35+
Accessing any member of `PyObject` is now prohibited, like the non-GIL
36+
stable ABI. For instance, prefer `Py_Type()` and `Py_SET_TYPE()` over manipulating `ob_type` directly,
37+
`Py_REFCNT`, `Py_INCREF()` and `Py_DecRef().` over `ob_refcnt`, etc.
3238

3339
Module Initialization
3440
=====================
@@ -412,10 +418,9 @@ Limited C API and Stable ABI
412418

413419
If you use
414420
`setuptools <https://setuptools.pypa.io/en/latest/setuptools.html>`_ to build
415-
your extension, a future version of `setuptools` will allow ``py_limited_api=True``
421+
your extension, a future version of `setuptools` will allow ``py_limited_api=True``
416422
to be set to allow targeting limited API when building with the free-threaded build.
417423

418-
419424
Windows
420425
.......
421426

0 commit comments

Comments
 (0)