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

Joshua Landau joshua at landau.ws
Tue Jan 20 17:47:48 CET 2015


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).


More information about the Python-ideas mailing list