[Python-checkins] bpo-12159: Document sys.maxsize limit in len() function reference (GH-17934)

Victor Stinner webhook-mailer at python.org
Sun Jan 12 04:04:36 EST 2020


https://github.com/python/cpython/commit/d7c7adde003ddca5cbe4fc47cf09464ab95a066e
commit: d7c7adde003ddca5cbe4fc47cf09464ab95a066e
branch: master
author: Zac Hatfield-Dodds <Zac-HD at users.noreply.github.com>
committer: Victor Stinner <vstinner at python.org>
date: 2020-01-12T10:04:14+01:00
summary:

bpo-12159: Document sys.maxsize limit in len() function reference (GH-17934)

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index dc3391ffe882d..cc48597ef91d5 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -892,6 +892,11 @@ are always available.  They are listed here in alphabetical order.
    sequence (such as a string, bytes, tuple, list, or range) or a collection
    (such as a dictionary, set, or frozen set).
 
+   .. impl-detail::
+
+      ``len`` raises :exc:`OverflowError` on lengths larger than
+      :data:`sys.maxsize`, such as :class:`range(2 ** 100) <range>`.
+
 
 .. _func-list:
 .. class:: list([iterable])



More information about the Python-checkins mailing list