[Python-checkins] bpo-45583: Correct datamodel documentation of int() (GH-29182) (GH-29286)

ambv webhook-mailer at python.org
Thu Oct 28 16:17:25 EDT 2021


https://github.com/python/cpython/commit/3767e0d94351653a34ba6a6914e57c5c231012b0
commit: 3767e0d94351653a34ba6a6914e57c5c231012b0
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-10-28T22:17:20+02:00
summary:

bpo-45583: Correct datamodel documentation of int() (GH-29182) (GH-29286)

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 at milchior.fr>

files:
M Doc/reference/datamodel.rst

diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 94f7e5a23b8a4..29a6987054df4 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -2512,8 +2512,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:



More information about the Python-checkins mailing list