mirror of
https://github.com/python/cpython
synced 2024-10-14 07:31:42 +00:00
gh-107298: Docs: add targets for some :c:member: and :c:macro: references (GH-107316)
Add targets for PyStructSequence_Desc and PyStructSequence_Field members and macros like Py_EQ. Fix target for Py_RETURN_RICHCOMPARE.
This commit is contained in:
parent
d363eb5b02
commit
abec9a1b20
|
@ -147,20 +147,21 @@ type.
|
||||||
|
|
||||||
Contains the meta information of a struct sequence type to create.
|
Contains the meta information of a struct sequence type to create.
|
||||||
|
|
||||||
+-------------------+------------------------------+--------------------------------------+
|
.. c:member:: const char *name
|
||||||
| Field | C Type | Meaning |
|
|
||||||
+===================+==============================+======================================+
|
Name of the struct sequence type.
|
||||||
| ``name`` | ``const char *`` | name of the struct sequence type |
|
|
||||||
+-------------------+------------------------------+--------------------------------------+
|
.. c:member:: const char *doc
|
||||||
| ``doc`` | ``const char *`` | pointer to docstring for the type |
|
|
||||||
| | | or ``NULL`` to omit |
|
Pointer to docstring for the type or ``NULL`` to omit.
|
||||||
+-------------------+------------------------------+--------------------------------------+
|
|
||||||
| ``fields`` | ``PyStructSequence_Field *`` | pointer to ``NULL``-terminated array |
|
.. c:member:: PyStructSequence_Field *fields
|
||||||
| | | with field names of the new type |
|
|
||||||
+-------------------+------------------------------+--------------------------------------+
|
Pointer to ``NULL``-terminated array with field names of the new type.
|
||||||
| ``n_in_sequence`` | ``int`` | number of fields visible to the |
|
|
||||||
| | | Python side (if used as tuple) |
|
.. c:member:: int n_in_sequence
|
||||||
+-------------------+------------------------------+--------------------------------------+
|
|
||||||
|
Number of fields visible to the Python side (if used as tuple).
|
||||||
|
|
||||||
|
|
||||||
.. c:type:: PyStructSequence_Field
|
.. c:type:: PyStructSequence_Field
|
||||||
|
@ -171,16 +172,14 @@ type.
|
||||||
the :c:type:`PyStructSequence_Desc` determines which
|
the :c:type:`PyStructSequence_Desc` determines which
|
||||||
field of the struct sequence is described.
|
field of the struct sequence is described.
|
||||||
|
|
||||||
+-----------+------------------+-----------------------------------------+
|
.. c:member:: const char *name
|
||||||
| Field | C Type | Meaning |
|
|
||||||
+===========+==================+=========================================+
|
Name for the field or ``NULL`` to end the list of named fields,
|
||||||
| ``name`` | ``const char *`` | name for the field or ``NULL`` to end |
|
set to :c:data:`PyStructSequence_UnnamedField` to leave unnamed.
|
||||||
| | | the list of named fields, set to |
|
|
||||||
| | | :c:data:`PyStructSequence_UnnamedField` |
|
.. c:member:: const char *doc
|
||||||
| | | to leave unnamed |
|
|
||||||
+-----------+------------------+-----------------------------------------+
|
Field docstring or ``NULL`` to omit.
|
||||||
| ``doc`` | ``const char *`` | field docstring or ``NULL`` to omit |
|
|
||||||
+-----------+------------------+-----------------------------------------+
|
|
||||||
|
|
||||||
|
|
||||||
.. c:var:: const char * const PyStructSequence_UnnamedField
|
.. c:var:: const char * const PyStructSequence_UnnamedField
|
||||||
|
|
|
@ -1513,21 +1513,23 @@ and :c:data:`PyType_Type` effectively act as defaults.)
|
||||||
The following constants are defined to be used as the third argument for
|
The following constants are defined to be used as the third argument for
|
||||||
:c:member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:
|
:c:member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:
|
||||||
|
|
||||||
+------------------+------------+
|
.. c:namespace:: NULL
|
||||||
| Constant | Comparison |
|
|
||||||
+==================+============+
|
+--------------------+------------+
|
||||||
| :c:macro:`Py_LT` | ``<`` |
|
| Constant | Comparison |
|
||||||
+------------------+------------+
|
+====================+============+
|
||||||
| :c:macro:`Py_LE` | ``<=`` |
|
| .. c:macro:: Py_LT | ``<`` |
|
||||||
+------------------+------------+
|
+--------------------+------------+
|
||||||
| :c:macro:`Py_EQ` | ``==`` |
|
| .. c:macro:: Py_LE | ``<=`` |
|
||||||
+------------------+------------+
|
+--------------------+------------+
|
||||||
| :c:macro:`Py_NE` | ``!=`` |
|
| .. c:macro:: Py_EQ | ``==`` |
|
||||||
+------------------+------------+
|
+--------------------+------------+
|
||||||
| :c:macro:`Py_GT` | ``>`` |
|
| .. c:macro:: Py_NE | ``!=`` |
|
||||||
+------------------+------------+
|
+--------------------+------------+
|
||||||
| :c:macro:`Py_GE` | ``>=`` |
|
| .. c:macro:: Py_GT | ``>`` |
|
||||||
+------------------+------------+
|
+--------------------+------------+
|
||||||
|
| .. c:macro:: Py_GE | ``>=`` |
|
||||||
|
+--------------------+------------+
|
||||||
|
|
||||||
The following macro is defined to ease writing rich comparison functions:
|
The following macro is defined to ease writing rich comparison functions:
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ Doc/c-api/set.rst
|
||||||
Doc/c-api/stable.rst
|
Doc/c-api/stable.rst
|
||||||
Doc/c-api/structures.rst
|
Doc/c-api/structures.rst
|
||||||
Doc/c-api/sys.rst
|
Doc/c-api/sys.rst
|
||||||
Doc/c-api/tuple.rst
|
|
||||||
Doc/c-api/type.rst
|
Doc/c-api/type.rst
|
||||||
Doc/c-api/typeobj.rst
|
Doc/c-api/typeobj.rst
|
||||||
Doc/c-api/unicode.rst
|
Doc/c-api/unicode.rst
|
||||||
|
|
Loading…
Reference in a new issue