diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2023-05-04 09:03:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-04 09:03:11 (GMT) |
commit | b0ce2db1184124575d5934d205344a9cf5debb79 (patch) | |
tree | d849d597b8f8e31791cd8053b861141147d7d59d /Doc/library/stdtypes.rst | |
parent | 33ca322c50baa5152afe388fb3b8b7d63dc5a9b9 (diff) | |
download | cpython-b0ce2db1184124575d5934d205344a9cf5debb79.zip cpython-b0ce2db1184124575d5934d205344a9cf5debb79.tar.gz cpython-b0ce2db1184124575d5934d205344a9cf5debb79.tar.bz2 |
GH-97950: Use new-style index directive ('operator') (#104156)
Diffstat (limited to 'Doc/library/stdtypes.rst')
-rw-r--r-- | Doc/library/stdtypes.rst | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 4c0a213..46b0389 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -61,8 +61,8 @@ objects considered false: ``range(0)`` .. index:: - operator: or - operator: and + pair: operator; or + pair: operator; and single: False single: True @@ -95,9 +95,9 @@ These are the Boolean operations, ordered by ascending priority: +-------------+---------------------------------+-------+ .. index:: - operator: and - operator: or - operator: not + pair: operator; and + pair: operator; or + pair: operator; not Notes: @@ -122,14 +122,14 @@ Comparisons .. index:: pair: chaining; comparisons pair: operator; comparison - operator: == - operator: < (less) - operator: <= - operator: > (greater) - operator: >= - operator: != - operator: is - operator: is not + pair: operator; == + pair: operator; < (less) + pair: operator; <= + pair: operator; > (greater) + pair: operator; >= + pair: operator; != + pair: operator; is + pair: operator; is not There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can @@ -192,8 +192,8 @@ customized; also they can be applied to any two objects and never raise an exception. .. index:: - operator: in - operator: not in + pair: operator; in + pair: operator; not in Two more operations with the same syntactic priority, :keyword:`in` and :keyword:`not in`, are supported by types that are :term:`iterable` or @@ -253,11 +253,11 @@ and imaginary parts. single: operator; - (minus) single: - (minus); unary operator single: - (minus); binary operator - operator: * (asterisk) - operator: / (slash) - operator: // - operator: % (percent) - operator: ** + pair: operator; * (asterisk) + pair: operator; / (slash) + pair: operator; // + pair: operator; % (percent) + pair: operator; ** Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the "narrower" type is @@ -392,12 +392,12 @@ Bitwise Operations on Integer Types pair: bitwise; operations pair: shifting; operations pair: masking; operations - operator: | (vertical bar) - operator: ^ (caret) - operator: & (ampersand) - operator: << - operator: >> - operator: ~ (tilde) + pair: operator; | (vertical bar) + pair: operator; ^ (caret) + pair: operator; & (ampersand) + pair: operator; << + pair: operator; >> + pair: operator; ~ (tilde) Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an @@ -952,8 +952,8 @@ operations have the same priority as the corresponding numeric operations. [3]_ pair: repetition; operation pair: subscript; operation pair: slice; operation - operator: in - operator: not in + pair: operator; in + pair: operator; not in single: count() (sequence method) single: index() (sequence method) |