A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-September/121786.html below:

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

[Python-Dev] TypeError: f() missing 1 required positional argument: 'x' [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'Steven D'Aprano steve at pearwood.info
Thu Sep 20 21:09:19 CEST 2012
On 21/09/12 01:53, Oscar Benjamin wrote:

> Mark Dickinson wrote:
>>>>> def f(x): pass
>> ...
>>>>> f()
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in<module>
>> TypeError: f() missing 1 required positional argument: 'x'
>
> I would say that the only problem with this terminology is that it would be
> good to think of a word to replace "keyword-only" (positionless?).

I disagree completely. I think keyword-only is the right terminology to
use for arguments which can only be passed by keyword. It is *positional*
that is questionable, since named positional arguments can be given by
keyword.

I would like to see error messages reserve the terms:

1) "positional" for explicitly positional-only parameters;
2) "keyword" for explicitly keyword-only parameters;

(I don't mind whether or not they use "-only" as a suffix)

For normal, named-positional-or-keyword arguments, just use an unqualified
"argument".



-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4