summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-29 05:48:10 (GMT)
committerGitHub <noreply@github.com>2023-07-29 05:48:10 (GMT)
commitf2d07d3289947d10b065b2bb7670c8fb6b6582f2 (patch)
tree4951b8b9118b548a868de6995c451aa33814dc1c /Doc/reference
parent413ba8943e2f1d896a0568eb571a041b88589440 (diff)
downloadcpython-f2d07d3289947d10b065b2bb7670c8fb6b6582f2.zip
cpython-f2d07d3289947d10b065b2bb7670c8fb6b6582f2.tar.gz
cpython-f2d07d3289947d10b065b2bb7670c8fb6b6582f2.tar.bz2
gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386)
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/datamodel.rst8
-rw-r--r--Doc/reference/expressions.rst2
-rw-r--r--Doc/reference/lexical_analysis.rst2
3 files changed, 6 insertions, 6 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index cbf8541..229fa69 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1594,9 +1594,9 @@ Basic customization
Called to implement truth value testing and the built-in operation
``bool()``; should return ``False`` or ``True``. When this method is not
- defined, :meth:`__len__` is called, if it is defined, and the object is
+ defined, :meth:`~object.__len__` is called, if it is defined, and the object is
considered true if its result is nonzero. If a class defines neither
- :meth:`__len__` nor :meth:`__bool__`, all its instances are considered
+ :meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered
true.
@@ -2494,7 +2494,7 @@ through the object's keys; for sequences, it should iterate through the values.
Called to implement the built-in function :func:`len`. Should return the length
of the object, an integer ``>=`` 0. Also, an object that doesn't define a
- :meth:`__bool__` method and whose :meth:`__len__` method returns zero is
+ :meth:`~object.__bool__` method and whose :meth:`!__len__` method returns zero is
considered to be false in a Boolean context.
.. impl-detail::
@@ -2503,7 +2503,7 @@ through the object's keys; for sequences, it should iterate through the values.
If the length is larger than :data:`!sys.maxsize` some features (such as
:func:`len`) may raise :exc:`OverflowError`. To prevent raising
:exc:`!OverflowError` by truth value testing, an object must define a
- :meth:`__bool__` method.
+ :meth:`~object.__bool__` method.
.. method:: object.__length_hint__(self)
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index ce1c9a5..8e0346c 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1724,7 +1724,7 @@ control flow statements, the following values are interpreted as false:
``False``, ``None``, numeric zero of all types, and empty strings and containers
(including strings, tuples, lists, dictionaries, sets and frozensets). All
other values are interpreted as true. User-defined objects can customize their
-truth value by providing a :meth:`__bool__` method.
+truth value by providing a :meth:`~object.__bool__` method.
.. index:: pair: operator; not
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index dde7ba1..83cd440 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -787,7 +787,7 @@ is converted before formatting. Conversion ``'!s'`` calls :func:`str` on
the result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`.
The result is then formatted using the :func:`format` protocol. The
-format specifier is passed to the :meth:`__format__` method of the
+format specifier is passed to the :meth:`~object.__format__` method of the
expression or conversion result. An empty string is passed when the
format specifier is omitted. The formatted result is then included in
the final value of the whole string.