Skip to content

Commit abec9a1

Browse files
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.
1 parent d363eb5 commit abec9a1

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

Doc/c-api/tuple.rst

+23-24
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,21 @@ type.
147147
148148
Contains the meta information of a struct sequence type to create.
149149
150-
+-------------------+------------------------------+--------------------------------------+
151-
| Field | C Type | Meaning |
152-
+===================+==============================+======================================+
153-
| ``name`` | ``const char *`` | name of the struct sequence type |
154-
+-------------------+------------------------------+--------------------------------------+
155-
| ``doc`` | ``const char *`` | pointer to docstring for the type |
156-
| | | or ``NULL`` to omit |
157-
+-------------------+------------------------------+--------------------------------------+
158-
| ``fields`` | ``PyStructSequence_Field *`` | pointer to ``NULL``-terminated array |
159-
| | | with field names of the new type |
160-
+-------------------+------------------------------+--------------------------------------+
161-
| ``n_in_sequence`` | ``int`` | number of fields visible to the |
162-
| | | Python side (if used as tuple) |
163-
+-------------------+------------------------------+--------------------------------------+
150+
.. c:member:: const char *name
151+
152+
Name of the struct sequence type.
153+
154+
.. c:member:: const char *doc
155+
156+
Pointer to docstring for the type or ``NULL`` to omit.
157+
158+
.. c:member:: PyStructSequence_Field *fields
159+
160+
Pointer to ``NULL``-terminated array with field names of the new type.
161+
162+
.. c:member:: int n_in_sequence
163+
164+
Number of fields visible to the Python side (if used as tuple).
164165
165166
166167
.. c:type:: PyStructSequence_Field
@@ -171,16 +172,14 @@ type.
171172
the :c:type:`PyStructSequence_Desc` determines which
172173
field of the struct sequence is described.
173174
174-
+-----------+------------------+-----------------------------------------+
175-
| Field | C Type | Meaning |
176-
+===========+==================+=========================================+
177-
| ``name`` | ``const char *`` | name for the field or ``NULL`` to end |
178-
| | | the list of named fields, set to |
179-
| | | :c:data:`PyStructSequence_UnnamedField` |
180-
| | | to leave unnamed |
181-
+-----------+------------------+-----------------------------------------+
182-
| ``doc`` | ``const char *`` | field docstring or ``NULL`` to omit |
183-
+-----------+------------------+-----------------------------------------+
175+
.. c:member:: const char *name
176+
177+
Name for the field or ``NULL`` to end the list of named fields,
178+
set to :c:data:`PyStructSequence_UnnamedField` to leave unnamed.
179+
180+
.. c:member:: const char *doc
181+
182+
Field docstring or ``NULL`` to omit.
184183
185184
186185
.. c:var:: const char * const PyStructSequence_UnnamedField

Doc/c-api/typeobj.rst

+17-15
Original file line numberDiff line numberDiff line change
@@ -1513,21 +1513,23 @@ and :c:data:`PyType_Type` effectively act as defaults.)
15131513
The following constants are defined to be used as the third argument for
15141514
:c:member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:
15151515

1516-
+------------------+------------+
1517-
| Constant | Comparison |
1518-
+==================+============+
1519-
| :c:macro:`Py_LT` | ``<`` |
1520-
+------------------+------------+
1521-
| :c:macro:`Py_LE` | ``<=`` |
1522-
+------------------+------------+
1523-
| :c:macro:`Py_EQ` | ``==`` |
1524-
+------------------+------------+
1525-
| :c:macro:`Py_NE` | ``!=`` |
1526-
+------------------+------------+
1527-
| :c:macro:`Py_GT` | ``>`` |
1528-
+------------------+------------+
1529-
| :c:macro:`Py_GE` | ``>=`` |
1530-
+------------------+------------+
1516+
.. c:namespace:: NULL
1517+
1518+
+--------------------+------------+
1519+
| Constant | Comparison |
1520+
+====================+============+
1521+
| .. c:macro:: Py_LT | ``<`` |
1522+
+--------------------+------------+
1523+
| .. c:macro:: Py_LE | ``<=`` |
1524+
+--------------------+------------+
1525+
| .. c:macro:: Py_EQ | ``==`` |
1526+
+--------------------+------------+
1527+
| .. c:macro:: Py_NE | ``!=`` |
1528+
+--------------------+------------+
1529+
| .. c:macro:: Py_GT | ``>`` |
1530+
+--------------------+------------+
1531+
| .. c:macro:: Py_GE | ``>=`` |
1532+
+--------------------+------------+
15311533

15321534
The following macro is defined to ease writing rich comparison functions:
15331535

Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Doc/c-api/set.rst
2323
Doc/c-api/stable.rst
2424
Doc/c-api/structures.rst
2525
Doc/c-api/sys.rst
26-
Doc/c-api/tuple.rst
2726
Doc/c-api/type.rst
2827
Doc/c-api/typeobj.rst
2928
Doc/c-api/unicode.rst

0 commit comments

Comments
 (0)