From 2b71234c6bcb512108dac0dc063085a792c96506 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Thu, 26 Feb 2026 12:05:44 +0100 Subject: [PATCH 1/2] Update PyDict_Copy documentation with note on frozendict --- Doc/c-api/dict.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst index 1d74140ea360ba..dbf10e8e65fb2e 100644 --- a/Doc/c-api/dict.rst +++ b/Doc/c-api/dict.rst @@ -81,6 +81,8 @@ Dictionary objects .. c:function:: PyObject* PyDict_Copy(PyObject *p) Return a new dictionary that contains the same key-value pairs as *p*. + If *p* is a subclass of :class:`frozendict`, the result will be + a :class:`frozendict` instance. .. c:function:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val) From c371bafcd55c03d4e8b397fd9f7b824f68026463 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Thu, 26 Feb 2026 15:22:36 +0100 Subject: [PATCH 2/2] review comments --- Doc/c-api/dict.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst index dbf10e8e65fb2e..734462bc0051af 100644 --- a/Doc/c-api/dict.rst +++ b/Doc/c-api/dict.rst @@ -81,9 +81,10 @@ Dictionary objects .. c:function:: PyObject* PyDict_Copy(PyObject *p) Return a new dictionary that contains the same key-value pairs as *p*. - If *p* is a subclass of :class:`frozendict`, the result will be - a :class:`frozendict` instance. + .. versionchanged:: next + If *p* is a subclass of :class:`frozendict`, the result will be a + :class:`frozendict` instance instead of a :class:`dict` instance. .. c:function:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)