[New-bugs-announce] [issue2690] Precompute range length
report at bugs.python.org
Fri Apr 25 17:32:02 CEST 2008
New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:
Attached patch makes range objects precompute their length on creation.
This speeds up indexing and len at the expense of a small increase in
range object size. The main benefit, however is that unsupported length >
sys.maxsize is detected early and confusing OverflowError from len(r) or
r[i] is avoided.
See discussion starting at http://mail.python.org/pipermail/python-
components: Interpreter Core
title: Precompute range length
versions: Python 3.0
Added file: http://bugs.python.org/file10107/range-length.diff
Tracker <report at bugs.python.org>
More information about the New-bugs-announce