From 7dae48436c19b74af47ce61cccf66ac273da217d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 5 Jul 2026 11:44:15 +0200 Subject: [PATCH] gh-151945: fix Sphinx warnings arising from `stable_abi.dat` --- Doc/c-api/intro.rst | 16 ++++++++++++++++ Doc/c-api/weakref.rst | 3 +++ Doc/conf.py | 16 ++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index 4c0c9af45e8360d..9b3cad54027034e 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -919,6 +919,22 @@ use them. See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest positive value of type :c:type:`Py_ssize_t`. +.. c:type:: Py_intptr_t + + A signed integral type such that a legitimate ``void*`` can be cast to + :c:type:`Py_intptr_t` and then back to ``void*`` again without loss of + information. + + Kept for backwards compatibility; prefer using ``intptr_t`` directly. + +.. c:type:: Py_uintptr_t + + An unsigned integral type such that a legitimate ``void*`` can be cast to + :c:type:`Py_uintptr_t` and then back to ``void*`` again without loss of + information. + + Kept for backwards compatibility; prefer using ``uintptr_t`` directly. + .. _api-exceptions: diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst index 8762a003c5218d3..dc060690b9d240d 100644 --- a/Doc/c-api/weakref.rst +++ b/Doc/c-api/weakref.rst @@ -10,6 +10,9 @@ specific object types which directly implement weak references. The first is a simple reference object, and the second acts as a proxy for the original object as much as it can. +.. c:type:: PyWeakReference + + The C structure of the objects used to describe weak references objects. .. c:function:: int PyWeakref_Check(PyObject *ob) diff --git a/Doc/conf.py b/Doc/conf.py index 9b103a594b235cf..2ff6a89d0f15feb 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -234,6 +234,22 @@ ('py:attr', '__wrapped__'), ] +# Objects present in the stable_abi.dat but removed from the docs +# or with suppressed references to them. +nitpick_ignore += [ + # pending removal in Python 3.16 + ('c:data', 'Py_FileSystemDefaultEncodeErrors'), + ('c:data', 'Py_FileSystemDefaultEncoding'), + ('c:data', 'Py_HasFileSystemDefaultEncoding'), + ('c:data', 'Py_UTF8Mode'), + # legacy typedefs for sq_slice and sq_ass_slice + ('c:type', 'ssizessizeargfunc'), + ('c:type', 'ssizessizeobjargproc'), + # 'symtable' was exposed by symtable.h but removed in 3.10. + # See https://github.com/python/cpython/pull/24910. + ('c:type', 'symtable'), +] + # gh-106948: Copy standard C types declared in the "c:type" domain and C # structures declared in the "c:struct" domain to the "c:identifier" domain, # since "c:function" markup looks for types in the "c:identifier" domain. Use