[Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

Terry Reedy tjreedy at udel.edu
Thu Sep 20 18:07:09 CEST 2012


On 9/20/2012 10:12 AM, Benjamin Peterson wrote:
> 2012/9/20 Mark Dickinson <dickinsm at gmail.com>:
>> Thoughts?
>
> I tried to define the error messages in terms of the callee's
> signature. I call the formals that are not variadic, keyword variadic,
> or keyword-only, positional. For example, in
>
> def f(a, b, c, *args, d):
>       pass
>
> a, b, and c are positional. Hence the "positional" in error messages.

They are positional-or-keyword without defaults.

> As you noted in your next message, keyword-only arguments need to be
> distinguished from these "positional" arguments somehow.

Positional-or-keyword and positional-only also need to be distinguished.
'Positional' is ambiguous. One problem for standardized error messages 
is the the header info does not always tell the complete story.

> I'm certainly open to suggestions.

I gave several suggestions for 'positional-or-keyword' in my response to 
Mark.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list