From 3d39247fe75a4c1fefbfcd56a77b40c781eb7cac Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 31 Jan 2024 10:29:01 +0300 Subject: [PATCH 1/2] gh-101100: Fix sphinx warnings in `c-api/gcsupport.rst` --- Doc/c-api/gcsupport.rst | 11 ++++++++--- Doc/tools/.nitignore | 1 - Misc/NEWS.d/3.12.0b1.rst | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst index 6b2494ee4f0ed4..c39982155cd605 100644 --- a/Doc/c-api/gcsupport.rst +++ b/Doc/c-api/gcsupport.rst @@ -83,10 +83,15 @@ rules: .. versionadded:: 3.12 -.. c:function:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize) +.. c:macro:: PyObject_GC_Resize(TYPE, op, newsize) - Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the - resized object or ``NULL`` on failure. *op* must not be tracked by the collector yet. + Resize an object allocated by :c:macro:`PyObject_NewVar`. + Returns the resized object of type ``TYPE*`` (refers to any C type) + or ``NULL`` on failure. + + *op* must of type :c:expr:`PyVarObject *` + and must not be tracked by the collector yet. + *newsize* must be of type :c:type:`Py_ssize_t`. .. c:function:: void PyObject_GC_Track(PyObject *op) diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 7eacb46d6299b3..0b0925af225d5f 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -5,7 +5,6 @@ Doc/c-api/descriptor.rst Doc/c-api/exceptions.rst Doc/c-api/float.rst -Doc/c-api/gcsupport.rst Doc/c-api/init.rst Doc/c-api/init_config.rst Doc/c-api/intro.rst diff --git a/Misc/NEWS.d/3.12.0b1.rst b/Misc/NEWS.d/3.12.0b1.rst index 211513d05d0040..21f2c748f40548 100644 --- a/Misc/NEWS.d/3.12.0b1.rst +++ b/Misc/NEWS.d/3.12.0b1.rst @@ -2371,7 +2371,7 @@ Add a new C-API function to eagerly assign a version tag to a PyTypeObject: .. nonce: _paFIF .. section: C API -:c:func:`PyObject_GC_Resize` should calculate preheader size if needed. +:c:macro:`PyObject_GC_Resize` should calculate preheader size if needed. Patch by Donghee Na. .. From a24d16ecc329b956500b5588d8d236c199f90cd5 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 31 Jan 2024 12:39:25 +0300 Subject: [PATCH 2/2] Update Doc/c-api/gcsupport.rst --- Doc/c-api/gcsupport.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst index c39982155cd605..621da3eb069949 100644 --- a/Doc/c-api/gcsupport.rst +++ b/Doc/c-api/gcsupport.rst @@ -89,7 +89,7 @@ rules: Returns the resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on failure. - *op* must of type :c:expr:`PyVarObject *` + *op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the collector yet. *newsize* must be of type :c:type:`Py_ssize_t`.