summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/init.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-27 00:52:40 (GMT)
committerGitHub <noreply@github.com>2023-07-27 00:52:40 (GMT)
commit8d61a71f9c81619e34d4a30b625922ebc83c561b (patch)
treebd75cd21a961bbf99156b29a5eeb853ba61366b1 /Doc/c-api/init.rst
parent391e03fa05b80d17a14ac88d30c974fa2fa00adb (diff)
downloadcpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.zip
cpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.tar.gz
cpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.tar.bz2
gh-107298: Fix more Sphinx warnings in the C API doc (#107329)
Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() Add C standard C types to nitpick_ignore in Doc/conf.py: * int64_t * uint64_t * uintptr_t No longer ignore non existing "__int" type in nitpick_ignore. Update Doc/tools/.nitignore
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r--Doc/c-api/init.rst18
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 48cea69..8d495da 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -25,7 +25,7 @@ The following functions can be safely called before Python is initialized:
* :c:func:`PyImport_AppendInittab`
* :c:func:`PyImport_ExtendInittab`
- * :c:func:`PyInitFrozenExtensions`
+ * :c:func:`!PyInitFrozenExtensions`
* :c:func:`PyMem_SetAllocator`
* :c:func:`PyMem_SetupDebugHooks`
* :c:func:`PyObject_SetArenaAllocator`
@@ -151,7 +151,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
:c:member:`PyConfig.use_environment` should be used instead, see
:ref:`Python Initialization Configuration <init-config>`.
- Ignore all :envvar:`PYTHON*` environment variables, e.g.
+ Ignore all :envvar:`!PYTHON*` environment variables, e.g.
:envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set.
Set by the :option:`-E` and :option:`-I` options.
@@ -224,7 +224,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
:ref:`Python Initialization Configuration <init-config>`.
If the flag is non-zero, use :class:`io.FileIO` instead of
- :class:`WindowsConsoleIO` for :mod:`sys` standard streams.
+ :class:`!io._WindowsConsoleIO` for :mod:`sys` standard streams.
Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment
variable is set to a non-empty string.
@@ -393,7 +393,7 @@ Initializing and finalizing the interpreter
the application.
**Bugs and caveats:** The destruction of modules and objects in modules is done
- in random order; this may cause destructors (:meth:`__del__` methods) to fail
+ in random order; this may cause destructors (:meth:`~object.__del__` methods) to fail
when they depend on other objects (even functions) or modules. Dynamically
loaded extension modules loaded by Python are not unloaded. Small amounts of
memory allocated by the Python interpreter may not be freed (if you find a leak,
@@ -417,7 +417,7 @@ Process-wide parameters
=======================
-.. c:function:: wchar* Py_GetProgramName()
+.. c:function:: wchar_t* Py_GetProgramName()
Return the program name set with :c:member:`PyConfig.program_name`, or the default.
The returned string points into static storage; the caller should not modify its
@@ -785,7 +785,7 @@ the fork, and releasing them afterwards. In addition, it resets any
:ref:`lock-objects` in the child. When extending or embedding Python, there
is no way to inform Python of additional (non-Python) locks that need to be
acquired before or reset after a fork. OS facilities such as
-:c:func:`pthread_atfork` would need to be used to accomplish the same thing.
+:c:func:`!pthread_atfork` would need to be used to accomplish the same thing.
Additionally, when extending or embedding Python, calling :c:func:`fork`
directly rather than through :func:`os.fork` (and returning to or calling
into Python) may result in a deadlock by one of Python's internal locks
@@ -849,7 +849,7 @@ code, or when embedding the Python interpreter:
.. note::
Calling this function from a thread when the runtime is finalizing
will terminate the thread, even if the thread was not created by Python.
- You can use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to
+ You can use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to
check if the interpreter is in process of being finalized before calling
this function to avoid unwanted termination.
@@ -895,7 +895,7 @@ with sub-interpreters:
.. note::
Calling this function from a thread when the runtime is finalizing
will terminate the thread, even if the thread was not created by Python.
- You can use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to
+ You can use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to
check if the interpreter is in process of being finalized before calling
this function to avoid unwanted termination.
@@ -1177,7 +1177,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
.. note::
Calling this function from a thread when the runtime is finalizing
will terminate the thread, even if the thread was not created by Python.
- You can use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to
+ You can use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to
check if the interpreter is in process of being finalized before calling
this function to avoid unwanted termination.