Martin Manns <mma...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7721>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to