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

Neil Girdhar mistersheik at gmail.com
Tue Jan 20 17:51:08 CET 2015


Okay, so: positional arguments neither follow keyword arguments nor keyword
argument unpackings; iterable argument unpackings never follow keyword
argument unpackings.



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

> On 20 January 2015 at 16:38, Guido van Rossum <guido at python.org> wrote:
> > The PEP hasn't been accepted yet AFAIK...  I'm generally okay with
> allowing
> > multiple *x things (except in an *unpack* position of course) but I still
> > don't think we should be mixing positional and keyword args. So, no f(a,
> > b=2, c), nor f(a, b=2, *c).
> >
>
> f(a, b=2, *c) is currently legal as both a call and as a definition:
>
>     a, *c = 1, 2, 3
>
>     def f(*args, **kwargs):
>         print(args, kwargs)
>
>     f(a, b=2, *c)
>     #>>> (1, 2, 3) {'b': 2}
>
>     def f(a, b=2, *c):
>         print(a, b, c)
>
>     f(1, 2, 3)
>     #>>> 1 2 (3,)
>
> So I imagine that's staying (or, at least, this PEP isn't removing
> it). I don't think anyone is (yet) arguing for f(a, b=2, c).
> _______________________________________________
> 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/06a9b430/attachment.html>


More information about the Python-ideas mailing list