[Python-ideas] What's going on with PEP 448 - Additional Unpacking Generalizations ?

Neil Girdhar mistersheik at gmail.com
Tue Jan 20 15:30:48 CET 2015


Ok, the final comma means a small change to the grammar.

In summary of the other rules:

positional argument never follow keyword arguments
iterable argument unpacking never follow keyword argument unpacking

Neither rule is truly necessary, but ok for now.

Best,

Neil



On Tue, Jan 20, 2015 at 9:22 AM, Joshua Landau <joshua at landau.ws> wrote:

> 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.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python-ideas/J99EFY1D1nI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> python-ideas+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150120/865bef81/attachment-0001.html>


More information about the Python-ideas mailing list