Re: [Python-ideas] Allow star unpacking within an slice expression
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
Reviving this old thread since this is hitting me again today. Is there any momentum on extending tuple unpacking to within slices? On Thursday, December 21, 2017 at 4:33:07 PM UTC-5, Neil Girdhar wrote:
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
06.03.20 18:30, Neil Girdhar пише:
Reviving this old thread since this is hitting me again today. Is there any momentum on extending tuple unpacking to within slices?
It does not supported by AST. But with issue34822 changes it could be implemented. https://bugs.python.org/issue34822
participants (2)
-
Neil Girdhar -
Serhiy Storchaka