[ python-Bugs-1303928 ] Extended slice bug (or feature?)

SourceForge.net noreply at sourceforge.net
Sun Sep 25 15:06:19 CEST 2005


Bugs item #1303928, was opened at 2005-09-25 13:06
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=1303928&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: David M. Beazley (beazley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Extended slice bug (or feature?)

Initial Comment:
Consider a sequence:

a = [1,2,3,4,5,6,7,8,9,10]

Now, consider the following slices:

b = a[:-5]        # b gets [1,2,3,4,5]
c = a[:-5:1]     # c gets [1,2,3,4,5]
d = a[:-5:-1]    # d gets [10,9,8,7]

Is this the intended behavior??  I would have suspected the value of 
d to be [5,4,3,2,1]  (the same elements of c, but in reverse order).

Thanks.  -- Dave


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

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


More information about the Python-bugs-list mailing list