[New-bugs-announce] [issue26428] The range for xrange() is too narrow

Serhiy Storchaka report at bugs.python.org
Wed Feb 24 11:40:45 EST 2016


New submission from Serhiy Storchaka:

The xrange() object works with integers in the range of C long, not Py_ssize_t. Thus the idiomatic expression xrange(len(seq)) can fail for real sequences if sys.maxint < sys.maxsize (e.g on 64-bit Windows).

Proposed patch changes the xrange() implementation to use Py_ssize_t instead of C long.

----------
components: Interpreter Core
files: xrange_py_ssize_t.patch
keywords: patch
messages: 260816
nosy: benjamin.peterson, haypo, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: The range for xrange() is too narrow
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42022/xrange_py_ssize_t.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26428>
_______________________________________


More information about the New-bugs-announce mailing list