[Python-ideas] Allow star unpacking within an slice expression

Neil Girdhar mistersheik at gmail.com
Thu Dec 21 16:33:07 EST 2017


I didn't think of this when we were discussing 448.  I ran into this today, 
so I agree with you that it would be nice to have this.

Best,

Neil

On Monday, December 4, 2017 at 1:02:09 AM UTC-5, Eric Wieser wrote:
>
> Hi,
>
> I've been thinking about the * unpacking operator while writing some numpy 
> code. PEP 448 allows the following:
>
>    values = 1, *some_tuple, 2
>    object[(1, *some_tuple, 2)]
>
> It seems reasonable to me that it should be extended to allow
>
>    item = object[1, *some_tuple, 2]
>    item = object[1, *some_tuple, :]
>
> Was this overlooked in the original proposal, or deliberately rejected?
>
> Eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171221/7911c1dd/attachment.html>


More information about the Python-ideas mailing list