Martin Manns added the comment:
So could we replace
"If a larger range is needed, an alternate version can be crafted using the
itertools module: islice(count(start, step), (stop-start+step-1)//step)."
by
"If a larger range is needed, an alternate version can be crafted using
Martin Manns added the comment:
Great solution!
Thank you
--
___
Python tracker
<http://bugs.python.org/issue7721>
___
___
Python-bugs-list mailing list
Unsub
Martin Manns 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 "", line
Martin Manns added the comment:
The new snippet does not work for me:
>>> list(irange(-12, 20, 4))
[-12, -8, -4, 0, 4]
I have attached code that seems to work.
It is more than a snipped though.
--
Added file: http://bugs.python.org/file15922/
New submission from Martin Manns :
In the Python 2.6.4 documentation "2. Built-in Functions" at
http://docs.python.org/library/functions.html,
the section about the xrange function (paragraph "CPython implementation
detail") contains the following code:
islice(count(start