New submission from Martin Manns <mma...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7721>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to