[Python-ideas] What's going on with PEP 448 - Additional Unpacking Generalizations ?
Joshua Landau
joshua at landau.ws
Tue Jan 20 15:22:13 CET 2015
On 20 January 2015 at 14:18, Joshua Landau <joshua at landau.ws> wrote:
> On 20 January 2015 at 11:02, Neil Girdhar <mistersheik at gmail.com> wrote:
>>
>> f(1, d=4, *[1,2], 2, **{})
>
> These should be OK, if I've understood the sentiment.
I meant, of course, to reply to your fixed version:
>> f(1, d=4, *[1,2], **{})
wrt.
>> Also, if after PEP 448, you can do
>>
>> f(*a, *b, *c)
>>
>> and you can always do
>>
>> f(a,
>> b,
>> c,
>> )
>>
>> then why shouldn't you be able to do
>>
>> f(*a,
>> *b,
>> *c,
>> )
I see no reason this shouldn't work.
On 20 January 2015 at 14:18, Joshua Landau <joshua at landau.ws> wrote:
> On 20 January 2015 at 11:02, Neil Girdhar <mistersheik at gmail.com> wrote:
>> I've been working on the patch for PEP 448. Are the restrictions on the
>> order of arguments in a function call partially or fully lifted?
>
> I believe we settled on
>
> function(
> argument or *args, argument or *args, ...,
> kwargument or *args, kwargument or *args, ...,
> kwargument or **kwargs, kwargument or **kwargs, ...
> )
>
> as the most likely candidate.
>
> Guido said
>> Regarding the decision about the allowable syntax for argument lists,
>> I prefer to keep the existing restriction
>
> See https://mail.python.org/pipermail/python-ideas/2013-July/021872.html
> for the discussion.
>
>> Currently, we can do:
>> def f(a, b, c, d):
>> pass
>>
>> f(1, d=4, *[1,2], 2, **{})
>>
>> After PEP 448 can we do:
>>
>> f(1, d=4, *[2], c=3, **{})
>>
>> ?
>
> These should be OK, if I've understood the sentiment.
More information about the Python-ideas
mailing list