Re: Slice lists and extended slicing

2011-01-26 Thread Terry Reedy
On 1/26/2011 12:52 PM, Benjamin Kaplan wrote: If you're trying to learn a language, I would suggest reading tutorials, not the grammar. I second that. As you can see from the error thrown, the operation is syntactically valid (you don't get a syntax error). It's just that lists don't accept

Re: Slice lists and extended slicing

2011-01-26 Thread Emile van Sebille
On 1/26/2011 9:20 AM Gerald Britton said... I'm looking at extended slicing and wondering when and how to use slice lists: I think the use of the term slice_list below is simply as the content between the encompassing brackets, eg in mylist[1:2:3] slice_list refers to 1:2:3. So, you don't ac

Re: Slice lists and extended slicing

2011-01-26 Thread Chris Rebert
On Wed, Jan 26, 2011 at 9:20 AM, Gerald Britton wrote: > I'm looking at extended slicing and wondering when and how to use slice lists: > > slicing          ::=  simple_slicing | extended_slicing > simple_slicing   ::=  primary "[" short_slice "]" > extended_slicing ::=  primary "[" slice_list "]"

Re: Slice lists and extended slicing

2011-01-26 Thread Robert Kern
On 1/26/11 11:20 AM, Gerald Britton wrote: I'm looking at extended slicing and wondering when and how to use slice lists: slicing ::= simple_slicing | extended_slicing simple_slicing ::= primary "[" short_slice "]" extended_slicing ::= primary "[" slice_list "]" slice_list ::

Re: Slice lists and extended slicing

2011-01-26 Thread Benjamin Kaplan
On Wed, Jan 26, 2011 at 12:20 PM, Gerald Britton wrote: > I'm looking at extended slicing and wondering when and how to use slice lists: > > slicing          ::=  simple_slicing | extended_slicing > simple_slicing   ::=  primary "[" short_slice "]" > extended_slicing ::=  primary "[" slice_list "]

Re: slice lists

2005-09-19 Thread jbperez808
> Lists are one-dimensional. They can only take one slice, not two. Ah ok, I thought l[3:4,5:8] would return [3,5,6,7] -- http://mail.python.org/mailman/listinfo/python-list

Re: slice lists

2005-09-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Reading: > > http://docs.python.org/ref/slicings.html > > it would seem to indicate that the ff will work: > > L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > > however, you get: > > >>> l[3:4:,5:8:] > Traceback (most recent call last): > File "", line 1, in ? >