Skip to content

Commit c201d29

Browse files
add docs
1 parent 36c4507 commit c201d29

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/api.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ Python 3.15
7070

7171
On PyPy, always returns ``-1``.
7272

73+
.. c:function:: int PyUnstable_SetImmortal(PyObject *op)
74+
75+
See `PyUnstable_SetImmortal() documentation <https://docs.python.org/dev/c-api/object.html#c.PyUnstable_SetImmortal>`__.
76+
7377

7478
Python 3.14
7579
-----------

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
* 2026-02-12: Add functions:
5+
6+
* ``PyUnstable_SetImmortal()``
7+
48
* 2025-10-14: Add functions:
59

610
* ``PyTuple_FromArray()``

pythoncapi_compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,6 +2660,10 @@ PyUnstable_Unicode_GET_CACHED_HASH(PyObject *op)
26602660
#endif
26612661

26622662
#if 0x030E0000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x030F00A7 && !defined(PYPY_VERSION)
2663+
// Immortal objects were implemented in Python 3.12, however there is no easy API
2664+
// to make objects immortal until 3.14 which has _Py_SetImmortal(). Since
2665+
// immortal objects are primarily needed for free-threading, this API is implemented
2666+
// for 3.14 and above.
26632667
extern void _Py_SetImmortal(PyObject *op);
26642668
static inline int
26652669
PyUnstable_SetImmortal(PyObject *op)

0 commit comments

Comments
 (0)