Skip to content

Commit 350b4c7

Browse files
[3.11] gh-101100: Fix Sphinx warnings in reference/expressions.rst (GH-114194) (#114437)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 804037e commit 350b4c7

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

Doc/reference/expressions.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ but does not affect the semantics.
984984

985985
The primary must evaluate to a callable object (user-defined functions, built-in
986986
functions, methods of built-in objects, class objects, methods of class
987-
instances, and all objects having a :meth:`__call__` method are callable). All
987+
instances, and all objects having a :meth:`~object.__call__` method are callable). All
988988
argument expressions are evaluated before the call is attempted. Please refer
989989
to section :ref:`function` for the syntax of formal :term:`parameter` lists.
990990

@@ -1142,7 +1142,7 @@ a class instance:
11421142
pair: instance; call
11431143
single: __call__() (object method)
11441144

1145-
The class must define a :meth:`__call__` method; the effect is then the same as
1145+
The class must define a :meth:`~object.__call__` method; the effect is then the same as
11461146
if that method was called.
11471147

11481148

@@ -1194,7 +1194,7 @@ Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`.
11941194
Raising a negative number to a fractional power results in a :class:`complex`
11951195
number. (In earlier versions it raised a :exc:`ValueError`.)
11961196

1197-
This operation can be customized using the special :meth:`__pow__` method.
1197+
This operation can be customized using the special :meth:`~object.__pow__` method.
11981198

11991199
.. _unary:
12001200

@@ -1217,15 +1217,15 @@ All unary arithmetic and bitwise operations have the same priority:
12171217
single: - (minus); unary operator
12181218

12191219
The unary ``-`` (minus) operator yields the negation of its numeric argument; the
1220-
operation can be overridden with the :meth:`__neg__` special method.
1220+
operation can be overridden with the :meth:`~object.__neg__` special method.
12211221

12221222
.. index::
12231223
single: plus
12241224
single: operator; + (plus)
12251225
single: + (plus); unary operator
12261226

12271227
The unary ``+`` (plus) operator yields its numeric argument unchanged; the
1228-
operation can be overridden with the :meth:`__pos__` special method.
1228+
operation can be overridden with the :meth:`~object.__pos__` special method.
12291229

12301230
.. index::
12311231
single: inversion
@@ -1234,7 +1234,7 @@ operation can be overridden with the :meth:`__pos__` special method.
12341234
The unary ``~`` (invert) operator yields the bitwise inversion of its integer
12351235
argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only
12361236
applies to integral numbers or to custom objects that override the
1237-
:meth:`__invert__` special method.
1237+
:meth:`~object.__invert__` special method.
12381238

12391239

12401240

@@ -1272,8 +1272,8 @@ the other must be a sequence. In the former case, the numbers are converted to a
12721272
common type and then multiplied together. In the latter case, sequence
12731273
repetition is performed; a negative repetition factor yields an empty sequence.
12741274

1275-
This operation can be customized using the special :meth:`__mul__` and
1276-
:meth:`__rmul__` methods.
1275+
This operation can be customized using the special :meth:`~object.__mul__` and
1276+
:meth:`~object.__rmul__` methods.
12771277

12781278
.. index::
12791279
single: matrix multiplication
@@ -1297,8 +1297,8 @@ integer; the result is that of mathematical division with the 'floor' function
12971297
applied to the result. Division by zero raises the :exc:`ZeroDivisionError`
12981298
exception.
12991299

1300-
This operation can be customized using the special :meth:`__truediv__` and
1301-
:meth:`__floordiv__` methods.
1300+
This operation can be customized using the special :meth:`~object.__truediv__` and
1301+
:meth:`~object.__floordiv__` methods.
13021302

13031303
.. index::
13041304
single: modulo
@@ -1323,7 +1323,7 @@ also overloaded by string objects to perform old-style string formatting (also
13231323
known as interpolation). The syntax for string formatting is described in the
13241324
Python Library Reference, section :ref:`old-string-formatting`.
13251325

1326-
The *modulo* operation can be customized using the special :meth:`__mod__` method.
1326+
The *modulo* operation can be customized using the special :meth:`~object.__mod__` method.
13271327

13281328
The floor division operator, the modulo operator, and the :func:`divmod`
13291329
function are not defined for complex numbers. Instead, convert to a floating
@@ -1339,8 +1339,8 @@ must either both be numbers or both be sequences of the same type. In the
13391339
former case, the numbers are converted to a common type and then added together.
13401340
In the latter case, the sequences are concatenated.
13411341

1342-
This operation can be customized using the special :meth:`__add__` and
1343-
:meth:`__radd__` methods.
1342+
This operation can be customized using the special :meth:`~object.__add__` and
1343+
:meth:`~object.__radd__` methods.
13441344

13451345
.. index::
13461346
single: subtraction
@@ -1350,7 +1350,7 @@ This operation can be customized using the special :meth:`__add__` and
13501350
The ``-`` (subtraction) operator yields the difference of its arguments. The
13511351
numeric arguments are first converted to a common type.
13521352

1353-
This operation can be customized using the special :meth:`__sub__` method.
1353+
This operation can be customized using the special :meth:`~object.__sub__` method.
13541354

13551355

13561356
.. _shifting:
@@ -1371,8 +1371,8 @@ The shifting operations have lower priority than the arithmetic operations:
13711371
These operators accept integers as arguments. They shift the first argument to
13721372
the left or right by the number of bits given by the second argument.
13731373

1374-
This operation can be customized using the special :meth:`__lshift__` and
1375-
:meth:`__rshift__` methods.
1374+
This operation can be customized using the special :meth:`~object.__lshift__` and
1375+
:meth:`~object.__rshift__` methods.
13761376

13771377
.. index:: pair: exception; ValueError
13781378

@@ -1399,26 +1399,26 @@ Each of the three bitwise operations has a different priority level:
13991399
pair: operator; & (ampersand)
14001400

14011401
The ``&`` operator yields the bitwise AND of its arguments, which must be
1402-
integers or one of them must be a custom object overriding :meth:`__and__` or
1403-
:meth:`__rand__` special methods.
1402+
integers or one of them must be a custom object overriding :meth:`~object.__and__` or
1403+
:meth:`~object.__rand__` special methods.
14041404

14051405
.. index::
14061406
pair: bitwise; xor
14071407
pair: exclusive; or
14081408
pair: operator; ^ (caret)
14091409

14101410
The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, which
1411-
must be integers or one of them must be a custom object overriding :meth:`__xor__` or
1412-
:meth:`__rxor__` special methods.
1411+
must be integers or one of them must be a custom object overriding :meth:`~object.__xor__` or
1412+
:meth:`~object.__rxor__` special methods.
14131413

14141414
.. index::
14151415
pair: bitwise; or
14161416
pair: inclusive; or
14171417
pair: operator; | (vertical bar)
14181418

14191419
The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which
1420-
must be integers or one of them must be a custom object overriding :meth:`__or__` or
1421-
:meth:`__ror__` special methods.
1420+
must be integers or one of them must be a custom object overriding :meth:`~object.__or__` or
1421+
:meth:`~object.__ror__` special methods.
14221422

14231423

14241424
.. _comparisons:
@@ -1485,7 +1485,7 @@ comparison implementation.
14851485
Because all types are (direct or indirect) subtypes of :class:`object`, they
14861486
inherit the default comparison behavior from :class:`object`. Types can
14871487
customize their comparison behavior by implementing
1488-
:dfn:`rich comparison methods` like :meth:`__lt__`, described in
1488+
:dfn:`rich comparison methods` like :meth:`~object.__lt__`, described in
14891489
:ref:`customization`.
14901490

14911491
The default behavior for equality comparison (``==`` and ``!=``) is based on
@@ -1649,12 +1649,12 @@ substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty strings are
16491649
always considered to be a substring of any other string, so ``"" in "abc"`` will
16501650
return ``True``.
16511651

1652-
For user-defined classes which define the :meth:`__contains__` method, ``x in
1652+
For user-defined classes which define the :meth:`~object.__contains__` method, ``x in
16531653
y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and
16541654
``False`` otherwise.
16551655

1656-
For user-defined classes which do not define :meth:`__contains__` but do define
1657-
:meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for which the
1656+
For user-defined classes which do not define :meth:`~object.__contains__` but do define
1657+
:meth:`~object.__iter__`, ``x in y`` is ``True`` if some value ``z``, for which the
16581658
expression ``x is z or x == z`` is true, is produced while iterating over ``y``.
16591659
If an exception is raised during the iteration, it is as if :keyword:`in` raised
16601660
that exception.

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ Doc/library/xmlrpc.server.rst
9999
Doc/library/zlib.rst
100100
Doc/reference/compound_stmts.rst
101101
Doc/reference/datamodel.rst
102-
Doc/reference/expressions.rst
103102
Doc/reference/import.rst
104103
Doc/tutorial/datastructures.rst
105104
Doc/using/windows.rst

0 commit comments

Comments
 (0)