[Python-3000] Cleaning up argument list parsing (was Re: More wishful thinking)

Walter Dörwald walter at livinglogic.de
Mon Apr 17 21:47:07 CEST 2006


Guido van Rossum wrote:
> On 4/17/06, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> The rest of it was just suggesting that permitting keyword
>> parameters/arguments after *args should be the *only* change we make in this
>> area. I don't see any point in permitting positional arguments to come after a
>> keyword argument, even at the call site (this ability was a side effect of
>> Talin's suggested implementation strategy).
> 
> Right. In the call foo(1, 2, abc=42, 3), what's the sequential
> parameter position for the 3? I think it's ambiguous in the sense that
> reasonable users could disagree what would be the best choice.
> 
> But in foo(1, 2, *args, 3, 4) there's no harm; nor is there harm in
> foo(1, 2, *args, abc=42, **kwds). I'm on the fence about foo(*args,
> **kwds, abc=42).

BTW, do we want to allow foo(1, *args1, 2, *args2, 3)?

And what about foo(bar=17, **kwargs1, baz=23, **kwargs2)?

Servus,
    Walter



More information about the Python-3000 mailing list