On Wed, May 19, 2010 at 4:42 PM, Giampaolo Rodolà <g.rod...@gmail.com> wrote:
>>>> class A:
> ...     def echo(self, x):
> ...             return x
> ...
>>>> a = A()
>>>> a.echo()
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> TypeError: echo() takes exactly 2 arguments (1 given)
>>>>
>
> I bet my last 2 cents this has already been raised in past but I want
> to give it a try and revamp the subject anyway.
> Is there a reason why the error shouldn't be adjusted to state that
> *1* argument is actually required instead of 2?
>
>
> --- Giampaolo

Because it actually does take two arguments (self and x) and it
only got one (self).

I understand the confusion (and was bitten by it myself when I
was a newbie) but the interpreter is only telling you the truth.

Geremy Condra
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to