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/2010-May/100232.html below:

[Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

[Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a methodGreg Ewing greg.ewing at canterbury.ac.nz
Fri May 21 02:53:16 CEST 2010
Ben Finney wrote:

>>Something like "1 argument in addition to 'self'" would be reasonably
>>clear and would cover both situations.
> 
> Except that there's nothing special to the syntax or parser about the
> name ‘self’.

That's true, but the use of the word 'self' here isn't meant
to refer to the name of a parameter. The message is aimed at
the caller of the function, who doesn't necessarily know or
care what the parameter is actually called.

The important thing is that it represents the object the method
is being called for, and 'self' is the traditional term used
when talking about that. I can't think of anything that would
be more accurate without being excessively verbose or pedantic.

-- 
Greg
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