[issue7721] Code in xrange documentation does not work

2010-02-20 Thread Martin Manns
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

[issue7721] Code in xrange documentation does not work

2010-01-16 Thread Martin Manns
Martin Manns added the comment: Great solution! Thank you -- ___ Python tracker <http://bugs.python.org/issue7721> ___ ___ Python-bugs-list mailing list Unsub

[issue7721] Code in xrange documentation does not work

2010-01-16 Thread Martin Manns
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

[issue7721] Code in xrange documentation does not work

2010-01-16 Thread Martin Manns
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/

[issue7721] Code in xrange documentation does not work

2010-01-16 Thread Martin Manns
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