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
 
Benjamin Peterson  
View profile  
 More options Sep 20 2012, 11:16 am
From: Benjamin Peterson <benja...@python.org>
Date: Thu, 20 Sep 2012 11:14:57 -0400
Local: Thurs, Sep 20 2012 11:14 am
Subject: Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'
2012/9/20 Mark Dickinson <dicki...@gmail.com>:

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

Why not?

>>> def f(a, b, c=3): pass
...
>>> f()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() missing 2 required positional arguments: 'a' and 'b'
>>> f(1, 2, 3, 4)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() takes from 2 to 3 positional arguments but 4 were given

--
Regards,
Benjamin
_______________________________________________
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.