[issue7721] Code in xrange documentation does not work

Martin Manns report at bugs.python.org
Sat Jan 16 22:56:02 CET 2010


New submission from Martin Manns <mmanns at gmx.net>:

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, step), (stop-start+step-1)//step)

However, count only accepts one parameter, so that this solution does
not work. Furthermore, islice only accepts positive values for step.

Therefore, the code does not work.

I tested this with Python 2.5.4 and Python 2.6.4 on Debian Linux (AMD64).

----------
assignee: georg.brandl
components: Documentation
messages: 97912
nosy: georg.brandl, mm
severity: normal
status: open
title: Code in xrange documentation does not work
versions: Python 2.5, Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7721>
_______________________________________


More information about the Python-bugs-list mailing list