[issue7721] Code in xrange documentation does not work
Martin Manns
report at bugs.python.org
Sun Jan 17 00:50:22 CET 2010
Martin Manns <mmanns at gmx.net> added the comment:
The new snippet works better.
>>> list(irange(-12, 20, 4))
[-12, -8, -4, 0, 4, 8, 12, 16]
However, it does not like large or negative slices:
>>> list(irange(-2**65,2**65,2**61))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
OverflowError: long int too large to convert to int
>>> list(irange(32,2,-3))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
ValueError: Indices for islice() must be non-negative integers or None.
Perhaps the documentation can mention that.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7721>
_______________________________________
More information about the Python-bugs-list
mailing list