This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mm
Recipients flox, georg.brandl, mm
Date 2010-01-16.23:50:20
SpamBayes Score 7.515847e-09
Marked as misclassified No
Message-id <1263685822.28.0.594281105399.issue7721@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-01-16 23:50:22mmsetrecipients: + mm, georg.brandl, flox
2010-01-16 23:50:22mmsetmessageid: <1263685822.28.0.594281105399.issue7721@psf.upfronthosting.co.za>
2010-01-16 23:50:21mmlinkissue7721 messages
2010-01-16 23:50:20mmcreate