[Python-bugs-list] [ python-Bugs-827190 ] wrong error message of islice indexing

SourceForge.net noreply at sourceforge.net
Mon Oct 20 18:46:14 EDT 2003


Bugs item #827190, was opened at 2003-10-21 07:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=827190&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: George Yoshida (quiver)
Assigned to: Nobody/Anonymous (nobody)
Summary: wrong error message of islice indexing

Initial Comment:
If you pass negative values to itertools.islice, you 
get a wrong error message.

Indices for itertools.islice() may be non-negative 
integers(zero is included), but the error message 
says that they must be positive.

I think the message needs to be corrected.


>>> from itertools import islice
>>> l = range(5)
>>> islice(l, 0, None)
<itertools.islice object at 0xa0cfb1c>
>>> islice(l, -1, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: Indices for islice() must be positive.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=827190&group_id=5470



More information about the Python-bugs-list mailing list