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

Mark Dickinson dickinsm at gmail.com
Thu Sep 20 16:59:36 CEST 2012


On Thu, Sep 20, 2012 at 3:12 PM, Benjamin Peterson <benjamin at python.org> wrote:
> As you noted in your next message, keyword-only arguments need to be
> distinguished from these "positional" arguments somehow. Maybe it
> helps to think of "positional" to mean "the only formals you can pass
> to with position" (excepting variadic ones).

And excepting optional ones, too, right? E.g., the c in
 def foo(a, b, c=1, *args, d):
 pass
can be passed to by position, but isn't "positional".
> I'm certainly open to suggestions.

Yes, I don't have a good alternative suggestion. If we could find a
suitable word and bless it in the documentation, it might make it
easier to make clear and accurate statements about Python's function
calling.
Mark


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /