mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107311)
(cherry picked from commit af61cb9c78)
This commit is contained in:
parent
bd0def00b3
commit
cfa9f3b7cc
7 changed files with 13 additions and 11 deletions
|
|
@ -138,7 +138,7 @@ Importing Modules
|
|||
:class:`SourceFileLoader` otherwise.
|
||||
|
||||
The module's :attr:`__file__` attribute will be set to the code object's
|
||||
:c:member:`co_filename`. If applicable, :attr:`__cached__` will also
|
||||
:attr:`co_filename`. If applicable, :attr:`__cached__` will also
|
||||
be set.
|
||||
|
||||
This function will reload the module if it was already imported. See
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ PyConfig
|
|||
Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv`
|
||||
is used, this method must be called before other methods, since the
|
||||
preinitialization configuration depends on command line arguments (if
|
||||
:c:member:`parse_argv` is non-zero).
|
||||
:c:member:`~PyConfig.parse_argv` is non-zero).
|
||||
|
||||
The caller of these methods is responsible to handle exceptions (error or
|
||||
exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``.
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
|
|||
|
||||
This memory area is allocated based on *m_size* on module creation,
|
||||
and freed when the module object is deallocated, after the
|
||||
:c:member:`m_free` function has been called, if present.
|
||||
:c:member:`~PyModuleDef.m_free` function has been called, if present.
|
||||
|
||||
Setting ``m_size`` to ``-1`` means that the module does not support
|
||||
sub-interpreters, because it has global state.
|
||||
|
|
@ -202,7 +202,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
|
|||
This function is not called if the module state was requested but is not
|
||||
allocated yet. This is the case immediately after the module is created
|
||||
and before the module is executed (:c:data:`Py_mod_exec` function). More
|
||||
precisely, this function is not called if :c:member:`m_size` is greater
|
||||
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
|
||||
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
|
||||
is ``NULL``.
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
|
|||
This function is not called if the module state was requested but is not
|
||||
allocated yet. This is the case immediately after the module is created
|
||||
and before the module is executed (:c:data:`Py_mod_exec` function). More
|
||||
precisely, this function is not called if :c:member:`m_size` is greater
|
||||
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
|
||||
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
|
||||
is ``NULL``.
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
|
|||
This function is not called if the module state was requested but is not
|
||||
allocated yet. This is the case immediately after the module is created
|
||||
and before the module is executed (:c:data:`Py_mod_exec` function). More
|
||||
precisely, this function is not called if :c:member:`m_size` is greater
|
||||
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
|
||||
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
|
||||
is ``NULL``.
|
||||
|
||||
|
|
|
|||
|
|
@ -263,14 +263,16 @@ Implementing functions and methods
|
|||
|
||||
points to the contents of the docstring
|
||||
|
||||
The :c:member:`ml_meth` is a C function pointer. The functions may be of different
|
||||
The :c:member:`~PyMethodDef.ml_meth` is a C function pointer.
|
||||
The functions may be of different
|
||||
types, but they always return :c:expr:`PyObject*`. If the function is not of
|
||||
the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
|
||||
Even though :c:type:`PyCFunction` defines the first parameter as
|
||||
:c:expr:`PyObject*`, it is common that the method implementation uses the
|
||||
specific C type of the *self* object.
|
||||
|
||||
The :c:member:`ml_flags` field is a bitfield which can include the following flags.
|
||||
The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include
|
||||
the following flags.
|
||||
The individual flags indicate either a calling convention or a binding
|
||||
convention.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue