Message 97922 - Python tracker (original) (raw)
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(-265,265,2**61)) Traceback (most recent call last): File "", line 1, in File "", line 1, in OverflowError: long int too large to convert to int
list(irange(32,2,-3)) Traceback (most recent call last): File "", line 1, in File "", line 1, in ValueError: Indices for islice() must be non-negative integers or None.
Perhaps the documentation can mention that.