mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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
This commit is contained in:
parent
4cd95dce0b
commit
f5088006ca
23 changed files with 77 additions and 77 deletions
|
@ -188,7 +188,7 @@ those made in the suite of the for-loop::
|
|||
|
||||
|
||||
.. index::
|
||||
builtin: range
|
||||
pair: built-in function; range
|
||||
|
||||
Names in the target list are not deleted when the loop is finished, but if the
|
||||
sequence is empty, they will not have been assigned to at all by the loop. Hint:
|
||||
|
|
|
@ -21,8 +21,8 @@ conformance to Von Neumann's model of a "stored program computer", code is also
|
|||
represented by objects.)
|
||||
|
||||
.. index::
|
||||
builtin: id
|
||||
builtin: type
|
||||
pair: built-in function; id
|
||||
pair: built-in function; type
|
||||
single: identity of an object
|
||||
single: value of an object
|
||||
single: type of an object
|
||||
|
@ -267,7 +267,7 @@ Ellipsis
|
|||
|
||||
Sequences
|
||||
.. index::
|
||||
builtin: len
|
||||
pair: built-in function; len
|
||||
pair: object; sequence
|
||||
single: index operation
|
||||
single: item selection
|
||||
|
@ -308,8 +308,8 @@ Sequences
|
|||
|
||||
Strings
|
||||
.. index::
|
||||
builtin: chr
|
||||
builtin: ord
|
||||
pair: built-in function; chr
|
||||
pair: built-in function; ord
|
||||
single: character
|
||||
single: integer
|
||||
single: Unicode
|
||||
|
@ -384,7 +384,7 @@ Sequences
|
|||
|
||||
Set types
|
||||
.. index::
|
||||
builtin: len
|
||||
pair: built-in function; len
|
||||
pair: object; set type
|
||||
|
||||
These represent unordered, finite sets of unique, immutable objects. As such,
|
||||
|
@ -418,7 +418,7 @@ Set types
|
|||
|
||||
Mappings
|
||||
.. index::
|
||||
builtin: len
|
||||
pair: built-in function; len
|
||||
single: subscription
|
||||
pair: object; mapping
|
||||
|
||||
|
@ -908,7 +908,7 @@ Class instances
|
|||
|
||||
I/O objects (also known as file objects)
|
||||
.. index::
|
||||
builtin: open
|
||||
pair: built-in function; open
|
||||
pair: module; io
|
||||
single: popen() (in module os)
|
||||
single: makefile() (socket method)
|
||||
|
@ -1177,7 +1177,7 @@ Internal types
|
|||
and the ``tb_next`` attribute of existing instances can be updated.
|
||||
|
||||
Slice objects
|
||||
.. index:: builtin: slice
|
||||
.. index:: pair: built-in function; slice
|
||||
|
||||
Slice objects are used to represent slices for
|
||||
:meth:`~object.__getitem__`
|
||||
|
@ -1411,7 +1411,7 @@ Basic customization
|
|||
|
||||
.. method:: object.__bytes__(self)
|
||||
|
||||
.. index:: builtin: bytes
|
||||
.. index:: pair: built-in function; bytes
|
||||
|
||||
Called by :ref:`bytes <func-bytes>` to compute a byte-string representation
|
||||
of an object. This should return a :class:`bytes` object.
|
||||
|
@ -1419,7 +1419,7 @@ Basic customization
|
|||
.. index::
|
||||
single: string; __format__() (object method)
|
||||
pair: string; conversion
|
||||
builtin: print
|
||||
pair: built-in function; print
|
||||
|
||||
|
||||
.. method:: object.__format__(self, format_spec)
|
||||
|
@ -1499,7 +1499,7 @@ Basic customization
|
|||
|
||||
.. index::
|
||||
pair: object; dictionary
|
||||
builtin: hash
|
||||
pair: built-in function; hash
|
||||
|
||||
Called by built-in function :func:`hash` and for operations on members of
|
||||
hashed collections including :class:`set`, :class:`frozenset`, and
|
||||
|
@ -2050,7 +2050,7 @@ Metaclasses
|
|||
|
||||
.. index::
|
||||
single: metaclass
|
||||
builtin: type
|
||||
pair: built-in function; type
|
||||
single: = (equals); class definition
|
||||
|
||||
By default, classes are constructed using :func:`type`. The class body is
|
||||
|
@ -2477,7 +2477,7 @@ through the object's keys; for sequences, it should iterate through the values.
|
|||
.. method:: object.__len__(self)
|
||||
|
||||
.. index::
|
||||
builtin: len
|
||||
pair: built-in function; len
|
||||
single: __bool__() (object method)
|
||||
|
||||
Called to implement the built-in function :func:`len`. Should return the length
|
||||
|
@ -2635,9 +2635,9 @@ left undefined.
|
|||
object.__or__(self, other)
|
||||
|
||||
.. index::
|
||||
builtin: divmod
|
||||
builtin: pow
|
||||
builtin: pow
|
||||
pair: built-in function; divmod
|
||||
pair: built-in function; pow
|
||||
pair: built-in function; pow
|
||||
|
||||
These methods are called to implement the binary arithmetic operations
|
||||
(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`,
|
||||
|
@ -2670,8 +2670,8 @@ left undefined.
|
|||
object.__ror__(self, other)
|
||||
|
||||
.. index::
|
||||
builtin: divmod
|
||||
builtin: pow
|
||||
pair: built-in function; divmod
|
||||
pair: built-in function; pow
|
||||
|
||||
These methods are called to implement the binary arithmetic operations
|
||||
(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`,
|
||||
|
@ -2683,7 +2683,7 @@ left undefined.
|
|||
``type(y).__rsub__(y, x)`` is called if ``type(x).__sub__(x, y)`` returns
|
||||
*NotImplemented*.
|
||||
|
||||
.. index:: builtin: pow
|
||||
.. index:: pair: built-in function; pow
|
||||
|
||||
Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the
|
||||
coercion rules would become too complicated).
|
||||
|
@ -2730,7 +2730,7 @@ left undefined.
|
|||
object.__abs__(self)
|
||||
object.__invert__(self)
|
||||
|
||||
.. index:: builtin: abs
|
||||
.. index:: pair: built-in function; abs
|
||||
|
||||
Called to implement the unary arithmetic operations (``-``, ``+``, :func:`abs`
|
||||
and ``~``).
|
||||
|
@ -2741,9 +2741,9 @@ left undefined.
|
|||
object.__float__(self)
|
||||
|
||||
.. index::
|
||||
builtin: complex
|
||||
builtin: int
|
||||
builtin: float
|
||||
pair: built-in function; complex
|
||||
pair: built-in function; int
|
||||
pair: built-in function; float
|
||||
|
||||
Called to implement the built-in functions :func:`complex`,
|
||||
:func:`int` and :func:`float`. Should return a value
|
||||
|
@ -2768,7 +2768,7 @@ left undefined.
|
|||
object.__floor__(self)
|
||||
object.__ceil__(self)
|
||||
|
||||
.. index:: builtin: round
|
||||
.. index:: pair: built-in function; round
|
||||
|
||||
Called to implement the built-in function :func:`round` and :mod:`math`
|
||||
functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`.
|
||||
|
|
|
@ -53,7 +53,7 @@ An expression statement evaluates the expression list (which may be a single
|
|||
expression).
|
||||
|
||||
.. index::
|
||||
builtin: repr
|
||||
pair: built-in function; repr
|
||||
pair: object; None
|
||||
pair: string; conversion
|
||||
single: output
|
||||
|
@ -970,9 +970,9 @@ annotation.
|
|||
them or silently change the meaning of the program.
|
||||
|
||||
.. index::
|
||||
builtin: exec
|
||||
builtin: eval
|
||||
builtin: compile
|
||||
pair: built-in function; exec
|
||||
pair: built-in function; eval
|
||||
pair: built-in function; compile
|
||||
|
||||
**Programmer's note:** :keyword:`global` is a directive to the parser. It
|
||||
applies only to code parsed at the same time as the :keyword:`!global` statement.
|
||||
|
|
|
@ -98,7 +98,7 @@ Expression input
|
|||
================
|
||||
|
||||
.. index:: single: input
|
||||
.. index:: builtin: eval
|
||||
.. index:: pair: built-in function; eval
|
||||
|
||||
:func:`eval` is used for expression input. It ignores leading whitespace. The
|
||||
string argument to :func:`eval` must have the following form:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue