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

Jim Jewett jimjjewett at gmail.com
Wed Apr 19 18:18:53 CEST 2006


On 4/19/06, Nick Coghlan <ncoghlan at gmail.com> wrote:

> Then you'd have:
>
>    def f(a, *(b, c=1, *args), **(d, e=2, **kwds)):
>        # Silly function
>
> 'a' would be a normal positional-or-keyword argument
> 'b' would be a required positional-only argument

Am I reading that correctly?

Looking only at a and b the possible calling signatures are exactly:

    f(1, 2)
    f(a=1, 2)

because b can't be named but must appear second, and nothing except a
can appear before it because of the rules on positional arguments.

-jJ


More information about the Python-3000 mailing list