[Python-ideas] List indexing multiple elements
levkivskyi at gmail.com
Mon Feb 20 16:14:33 EST 2017
On 20 February 2017 at 22:05, Jonathan Goble <jcgoble3 at gmail.com> wrote:
> On Mon, Feb 20, 2017 at 3:55 PM Ryan Gonzalez <rymg19 at gmail.com> wrote:
>> - Right now, a[b,c] is already valid syntax, since it's just indexing a
>> with the tuple (b, c). The proposal is to make this a specialization in the
>> grammar, and also allow stuff like a[b:c, d:e] (like
>> `a.__getitem__(slice(b, c), slice(d, e))`).
> The syntax/grammar already permits slices to be used in this fashion:
Moreover, this syntax is already extensively used by numpy and means
something different - multidimensional slicing.
Having a different semantics for lists would be therefore confusing.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas