New submission from Alexander Belopolsky <[EMAIL PROTECTED]>:

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-
3000/2008-April/013225.html .

----------
components: Interpreter Core
files: range-length.diff
keywords: patch
messages: 65786
nosy: belopolsky
severity: normal
status: open
title: Precompute range length
type: performance
versions: Python 3.0
Added file: http://bugs.python.org/file10107/range-length.diff

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2690>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to