Skip to content

Commit f508800

Browse files
authored
GH-97950: Use new-style index directive ('builtin') (#104164)
* Uncomment builtin removal in pairindextypes * Use new-style index directive ('builtin') - C API * Use new-style index directive ('builtin') - Extending * Use new-style index directive ('builtin') - Library * Use new-style index directive ('builtin') - Reference * Use new-style index directive ('builtin') - Tutorial
1 parent 4cd95dc commit f508800

23 files changed

+77
-77
lines changed

Doc/c-api/dict.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Dictionary Objects
154154
155155
.. c:function:: Py_ssize_t PyDict_Size(PyObject *p)
156156
157-
.. index:: builtin: len
157+
.. index:: pair: built-in function; len
158158
159159
Return the number of items in the dictionary. This is equivalent to
160160
``len(p)`` on a dictionary.

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Importing Modules
4141
4242
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
4343
44-
.. index:: builtin: __import__
44+
.. index:: pair: built-in function; __import__
4545
4646
Import a module. This is best described by referring to the built-in Python
4747
function :func:`__import__`.
@@ -120,7 +120,7 @@ Importing Modules
120120
121121
.. c:function:: PyObject* PyImport_ExecCodeModule(const char *name, PyObject *co)
122122
123-
.. index:: builtin: compile
123+
.. index:: pair: built-in function; compile
124124
125125
Given a module name (possibly of the form ``package.module``) and a code object
126126
read from a Python bytecode file or obtained from the built-in function

Doc/c-api/list.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ List Objects
4545
4646
.. c:function:: Py_ssize_t PyList_Size(PyObject *list)
4747
48-
.. index:: builtin: len
48+
.. index:: pair: built-in function; len
4949
5050
Return the length of the list object in *list*; this is equivalent to
5151
``len(list)`` on a list object.
@@ -138,7 +138,7 @@ List Objects
138138
139139
.. c:function:: PyObject* PyList_AsTuple(PyObject *list)
140140
141-
.. index:: builtin: tuple
141+
.. index:: pair: built-in function; tuple
142142
143143
Return a new tuple object containing the contents of *list*; equivalent to
144144
``tuple(list)``.

Doc/c-api/mapping.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
2020
.. c:function:: Py_ssize_t PyMapping_Size(PyObject *o)
2121
Py_ssize_t PyMapping_Length(PyObject *o)
2222
23-
.. index:: builtin: len
23+
.. index:: pair: built-in function; len
2424
2525
Returns the number of keys in object *o* on success, and ``-1`` on failure.
2626
This is equivalent to the Python expression ``len(o)``.

Doc/c-api/number.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ Number Protocol
6464
6565
.. c:function:: PyObject* PyNumber_Divmod(PyObject *o1, PyObject *o2)
6666
67-
.. index:: builtin: divmod
67+
.. index:: pair: built-in function; divmod
6868
6969
See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This is
7070
the equivalent of the Python expression ``divmod(o1, o2)``.
7171
7272
7373
.. c:function:: PyObject* PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3)
7474
75-
.. index:: builtin: pow
75+
.. index:: pair: built-in function; pow
7676
7777
See the built-in function :func:`pow`. Returns ``NULL`` on failure. This is the
7878
equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is optional.
@@ -94,7 +94,7 @@ Number Protocol
9494
9595
.. c:function:: PyObject* PyNumber_Absolute(PyObject *o)
9696
97-
.. index:: builtin: abs
97+
.. index:: pair: built-in function; abs
9898
9999
Returns the absolute value of *o*, or ``NULL`` on failure. This is the equivalent
100100
of the Python expression ``abs(o)``.
@@ -192,7 +192,7 @@ Number Protocol
192192
193193
.. c:function:: PyObject* PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3)
194194
195-
.. index:: builtin: pow
195+
.. index:: pair: built-in function; pow
196196
197197
See the built-in function :func:`pow`. Returns ``NULL`` on failure. The operation
198198
is done *in-place* when *o1* supports it. This is the equivalent of the Python
@@ -238,15 +238,15 @@ Number Protocol
238238
239239
.. c:function:: PyObject* PyNumber_Long(PyObject *o)
240240
241-
.. index:: builtin: int
241+
.. index:: pair: built-in function; int
242242
243243
Returns the *o* converted to an integer object on success, or ``NULL`` on
244244
failure. This is the equivalent of the Python expression ``int(o)``.
245245
246246
247247
.. c:function:: PyObject* PyNumber_Float(PyObject *o)
248248
249-
.. index:: builtin: float
249+
.. index:: pair: built-in function; float
250250
251251
Returns the *o* converted to a float object on success, or ``NULL`` on failure.
252252
This is the equivalent of the Python expression ``float(o)``.

Doc/c-api/object.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Object Protocol
190190
191191
.. c:function:: PyObject* PyObject_Repr(PyObject *o)
192192
193-
.. index:: builtin: repr
193+
.. index:: pair: built-in function; repr
194194
195195
Compute a string representation of object *o*. Returns the string
196196
representation on success, ``NULL`` on failure. This is the equivalent of the
@@ -202,7 +202,7 @@ Object Protocol
202202
203203
.. c:function:: PyObject* PyObject_ASCII(PyObject *o)
204204
205-
.. index:: builtin: ascii
205+
.. index:: pair: built-in function; ascii
206206
207207
As :c:func:`PyObject_Repr`, compute a string representation of object *o*, but
208208
escape the non-ASCII characters in the string returned by
@@ -227,7 +227,7 @@ Object Protocol
227227
228228
.. c:function:: PyObject* PyObject_Bytes(PyObject *o)
229229
230-
.. index:: builtin: bytes
230+
.. index:: pair: built-in function; bytes
231231
232232
Compute a bytes representation of object *o*. ``NULL`` is returned on
233233
failure and a bytes object on success. This is equivalent to the Python
@@ -278,7 +278,7 @@ Object Protocol
278278
279279
.. c:function:: Py_hash_t PyObject_Hash(PyObject *o)
280280
281-
.. index:: builtin: hash
281+
.. index:: pair: built-in function; hash
282282
283283
Compute and return the hash value of an object *o*. On failure, return ``-1``.
284284
This is the equivalent of the Python expression ``hash(o)``.
@@ -312,7 +312,7 @@ Object Protocol
312312
313313
.. c:function:: PyObject* PyObject_Type(PyObject *o)
314314
315-
.. index:: builtin: type
315+
.. index:: pair: built-in function; type
316316
317317
When *o* is non-``NULL``, returns a type object corresponding to the object type
318318
of object *o*. On failure, raises :exc:`SystemError` and returns ``NULL``. This
@@ -332,7 +332,7 @@ Object Protocol
332332
.. c:function:: Py_ssize_t PyObject_Size(PyObject *o)
333333
Py_ssize_t PyObject_Length(PyObject *o)
334334
335-
.. index:: builtin: len
335+
.. index:: pair: built-in function; len
336336
337337
Return the length of object *o*. If the object *o* provides either the sequence
338338
and mapping protocols, the sequence length is returned. On error, ``-1`` is

Doc/c-api/sequence.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Sequence Protocol
1818
.. c:function:: Py_ssize_t PySequence_Size(PyObject *o)
1919
Py_ssize_t PySequence_Length(PyObject *o)
2020
21-
.. index:: builtin: len
21+
.. index:: pair: built-in function; len
2222
2323
Returns the number of objects in sequence *o* on success, and ``-1`` on
2424
failure. This is equivalent to the Python expression ``len(o)``.
@@ -120,7 +120,7 @@ Sequence Protocol
120120
121121
.. c:function:: PyObject* PySequence_Tuple(PyObject *o)
122122
123-
.. index:: builtin: tuple
123+
.. index:: pair: built-in function; tuple
124124
125125
Return a tuple object with the same contents as the sequence or iterable *o*,
126126
or ``NULL`` on failure. If *o* is a tuple, a new reference will be returned,

Doc/c-api/set.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ or :class:`frozenset` or instances of their subtypes.
107107
108108
.. c:function:: Py_ssize_t PySet_Size(PyObject *anyset)
109109
110-
.. index:: builtin: len
110+
.. index:: pair: built-in function; len
111111
112112
Return the length of a :class:`set` or :class:`frozenset` object. Equivalent to
113113
``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a

Doc/c-api/structures.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ method.
347347
348348
.. data:: METH_CLASS
349349
350-
.. index:: builtin: classmethod
350+
.. index:: pair: built-in function; classmethod
351351
352352
The method will be passed the type object as the first parameter rather
353353
than an instance of the type. This is used to create *class methods*,
@@ -357,7 +357,7 @@ method.
357357
358358
.. data:: METH_STATIC
359359
360-
.. index:: builtin: staticmethod
360+
.. index:: pair: built-in function; staticmethod
361361
362362
The method will be passed ``NULL`` as the first parameter rather than an
363363
instance of the type. This is used to create *static methods*, similar to

Doc/c-api/typeobj.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
805805

806806
.. c:member:: reprfunc PyTypeObject.tp_repr
807807
808-
.. index:: builtin: repr
808+
.. index:: pair: built-in function; repr
809809

810810
An optional pointer to a function that implements the built-in function
811811
:func:`repr`.
@@ -870,7 +870,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
870870

871871
.. c:member:: hashfunc PyTypeObject.tp_hash
872872
873-
.. index:: builtin: hash
873+
.. index:: pair: built-in function; hash
874874

875875
An optional pointer to a function that implements the built-in function
876876
:func:`hash`.

0 commit comments

Comments
 (0)