]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45583: Correct datamodel documentation of int() (GH-29182) (GH-29287)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 28 Oct 2021 20:02:07 +0000 (13:02 -0700)
committerGitHub <noreply@github.com>
Thu, 28 Oct 2021 20:02:07 +0000 (22:02 +0200)
It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.
(cherry picked from commit d9c1868c25ec6466e8d8ae21fe9315a8a03836ab)

Co-authored-by: Arthur Milchior <arthur@milchior.fr>
Doc/reference/datamodel.rst

index 20d6e326b8b5ee96466140feb7e779d87725c609..92058aa4ed8867af665b1c697e107f58f354b880 100644 (file)
@@ -2507,8 +2507,8 @@ left undefined.
    return the value of the object truncated to an :class:`~numbers.Integral`
    (typically an :class:`int`).
 
-   If :meth:`__int__` is not defined then the built-in function :func:`int`
-   falls back to :meth:`__trunc__`.
+   The built-in function :func:`int` falls back to :meth:`__trunc__` if neither
+   :meth:`__int__` nor :meth:`__index__` is defined.
 
 
 .. _context-managers: