Skip to content

Commit 36e96ba

Browse files
[3.12] gh-107298: Docs: add targets for some :c:member: and :c:macro: references (GH-107316) (GH-107332)
Add targets for PyStructSequence_Desc and PyStructSequence_Field members and macros like Py_EQ. Fix target for Py_RETURN_RICHCOMPARE. (cherry picked from commit abec9a1) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 434e3b8 commit 36e96ba

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
@@ -144,20 +144,21 @@ type.
144144
145145
Contains the meta information of a struct sequence type to create.
146146
147-
+-------------------+------------------------------+--------------------------------------+
148-
| Field | C Type | Meaning |
149-
+===================+==============================+======================================+
150-
| ``name`` | ``const char *`` | name of the struct sequence type |
151-
+-------------------+------------------------------+--------------------------------------+
152-
| ``doc`` | ``const char *`` | pointer to docstring for the type |
153-
| | | or ``NULL`` to omit |
154-
+-------------------+------------------------------+--------------------------------------+
155-
| ``fields`` | ``PyStructSequence_Field *`` | pointer to ``NULL``-terminated array |
156-
| | | with field names of the new type |
157-
+-------------------+------------------------------+--------------------------------------+
158-
| ``n_in_sequence`` | ``int`` | number of fields visible to the |
159-
| | | Python side (if used as tuple) |
160-
+-------------------+------------------------------+--------------------------------------+
147+
.. c:member:: const char *name
148+
149+
Name of the struct sequence type.
150+
151+
.. c:member:: const char *doc
152+
153+
Pointer to docstring for the type or ``NULL`` to omit.
154+
155+
.. c:member:: PyStructSequence_Field *fields
156+
157+
Pointer to ``NULL``-terminated array with field names of the new type.
158+
159+
.. c:member:: int n_in_sequence
160+
161+
Number of fields visible to the Python side (if used as tuple).
161162
162163
163164
.. c:type:: PyStructSequence_Field
@@ -168,16 +169,14 @@ type.
168169
the :c:type:`PyStructSequence_Desc` determines which
169170
field of the struct sequence is described.
170171
171-
+-----------+------------------+-----------------------------------------+
172-
| Field | C Type | Meaning |
173-
+===========+==================+=========================================+
174-
| ``name`` | ``const char *`` | name for the field or ``NULL`` to end |
175-
| | | the list of named fields, set to |
176-
| | | :c:data:`PyStructSequence_UnnamedField` |
177-
| | | to leave unnamed |
178-
+-----------+------------------+-----------------------------------------+
179-
| ``doc`` | ``const char *`` | field docstring or ``NULL`` to omit |
180-
+-----------+------------------+-----------------------------------------+
172+
.. c:member:: const char *name
173+
174+
Name for the field or ``NULL`` to end the list of named fields,
175+
set to :c:data:`PyStructSequence_UnnamedField` to leave unnamed.
176+
177+
.. c:member:: const char *doc
178+
179+
Field docstring or ``NULL`` to omit.
181180
182181
183182
.. 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
@@ -36,7 +36,6 @@ Doc/c-api/set.rst
3636
Doc/c-api/stable.rst
3737
Doc/c-api/structures.rst
3838
Doc/c-api/sys.rst
39-
Doc/c-api/tuple.rst
4039
Doc/c-api/type.rst
4140
Doc/c-api/typehints.rst
4241
Doc/c-api/typeobj.rst

0 commit comments

Comments
 (0)