Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion TypeError: f() missing 1 required positional argument: 'x'
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Guido van Rossum  
View profile  
 More options Sep 20 2012, 11:54 am
From: Guido van Rossum <gu...@python.org>
Date: Thu, 20 Sep 2012 08:52:47 -0700
Local: Thurs, Sep 20 2012 11:52 am
Subject: Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

On Thu, Sep 20, 2012 at 7:12 AM, Benjamin Peterson <benja...@python.org> wrote:
> 2012/9/20 Mark Dickinson <dicki...@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.

No -- Mark's point is that (even given this syntax) you *could* pass
them using keywords.

I think Brett's got it right and we should just refer to a and b as
'arguments'. For d, we should use keyword arguments (or, in full,
keyword-only arguments). That's enough of a distinction.

Of course, in a specific call, we can continue to refer to positional
and keyword arguments based on the actual syntax used in the call.

Maybe this is also a good time to start distinguishing between
arguments (what you pass, call syntax) and parameters (what the
function receives, function definition syntax)?

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

> I'm certainly open to suggestions.

--
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-...@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/dev-python%2Bgarchi...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.