on slices, negative indices, which are the equivalent procedures?

Hope Rouselle hrouselle at jevedi.com
Fri Aug 20 13:33:09 EDT 2021


Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

> On Sun, 15 Aug 2021 00:05:29 -0300, Jack Brandom <jbrandom at example.com>
> declaimed the following:
>
>>Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
>>
>
>>> subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]
>>> sliceop: ':' [test]
>
>>
>>This is looking less readable, so, no, I prefer that previous, which was
>>much clearer about slices.  I can't even quite make the slices out in
>>these rules.  (But thanks for the opportunity to try.)
>
> 	The last part of "subscript" has the main "slice" notation (stripping
> the quotes)
>
> 		[test] : [test]
>
> and the "stride" component is [sliceop] being
>
> 		: [test]

Let's see.  Let ``-->'' mean ``expands to''.  Then

      subscript 
  --> [test] ':' [test] [sliceop]
  --> [test] ':' [test] ':' [test]

Does the brackets mean that its content count be omitted?


More information about the Python-list mailing list