[Python-ideas] List indexing multiple elements

Ivan Levkivskyi 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.

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170220/08533e06/attachment-0001.html>


More information about the Python-ideas mailing list