https://github.com/python/cpython/commit/50c479e613beccf38b6ac2e5fe4e03dab8bbcb28
commit: 50c479e613beccf38b6ac2e5fe4e03dab8bbcb28
branch: main
author: Kumar Aditya <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-02-15T20:21:54+05:30
summary:

add whatsnew entry for `PyUnstable_SetImmortal` and `PyDatetime_IMPORT` 
(#144830)

files:
M Doc/c-api/datetime.rst
M Doc/whatsnew/3.15.rst

diff --git a/Doc/c-api/datetime.rst b/Doc/c-api/datetime.rst
index 127d7c9c91a3d5..d7b4e116c49e35 100644
--- a/Doc/c-api/datetime.rst
+++ b/Doc/c-api/datetime.rst
@@ -30,6 +30,10 @@ macros.
 
       This is not compatible with subinterpreters.
 
+   .. versionchanged:: 3.15
+
+      This macro is now thread safe.
+
 .. c:type:: PyDateTime_CAPI
 
    Structure containing the fields for the datetime C API.
@@ -44,6 +48,11 @@ macros.
 
    This variable is only available once :c:macro:`PyDateTime_IMPORT` succeeds.
 
+   .. versionchanged:: 3.15
+
+      This variable should not be accessed directly as direct access is not 
thread-safe.
+      Use :c:func:`PyDateTime_IMPORT` instead.
+
 .. c:type:: PyDateTime_Date
 
    This subtype of :c:type:`PyObject` represents a Python date object.
diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst
index 0e440ccfd011f0..cd80947924684d 100644
--- a/Doc/whatsnew/3.15.rst
+++ b/Doc/whatsnew/3.15.rst
@@ -1563,6 +1563,8 @@ New features
   thread state.
   (Contributed by Victor Stinner in :gh:`139653`.)
 
+* Add :c:func:`PyUnstable_SetImmortal` C-API function to mark objects as 
:term:`immortal`.
+  (Contributed by Kumar Aditya in :gh:`143300`.)
 
 Changed C APIs
 --------------
@@ -1571,6 +1573,9 @@ Changed C APIs
   flag is set then :c:macro:`Py_TPFLAGS_HAVE_GC` must be set too.
   (Contributed by Sergey Miryanov in :gh:`134786`.)
 
+* :c:macro:`PyDateTime_IMPORT` is now thread safe. Code that directly checks 
``PyDateTimeAPI``
+  for ``NULL`` should be updated to call :c:macro:`PyDateTime_IMPORT` instead.
+  (Contributed by Kumar Aditya in :gh:`141563`.)
 
 Porting to Python 3.15
 ----------------------

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to