]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
add whatsnew entry for `PyUnstable_SetImmortal` and `PyDatetime_IMPORT` (#144830)
authorKumar Aditya <kumaraditya@python.org>
Sun, 15 Feb 2026 14:51:54 +0000 (20:21 +0530)
committerGitHub <noreply@github.com>
Sun, 15 Feb 2026 14:51:54 +0000 (20:21 +0530)
Doc/c-api/datetime.rst
Doc/whatsnew/3.15.rst

index 127d7c9c91a3d5f310944a4b8d9bdb848c19ee18..d7b4e116c49e35502e9ab1f4bf099b9a97188ed4 100644 (file)
@@ -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.
index 0e440ccfd011f07c7efb690ecc5bba4a08244068..cd80947924684d727fd1d7175a07b7a8b43571ea 100644 (file)
@@ -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
 ----------------------