noob question: "TypeError" wrong number of args

Ben Finney bignose+hates-spam at benfinney.id.au
Tue May 2 19:49:36 EDT 2006


Edward Elliott <nobody at 127.0.0.1> writes:

> Compiler, interpreter, magic-codey-runny-thingy, whatever, at some point
> something has to translate this source code
>   def method (self, a, b): something
> into a function object (or whatever you're calling the runnable code this
> week).  Call this translator Foo.  Whatever Foo is, it can insert 'self'
> into the parameter list for method, e.g. when it sees "def method (a,b)" it
> pretend like it saw "def method (self,a,b)" and proceed as usual.  Once it
> does that, everything is exactly the same as before.

So now you're proposing that this be a special case when a function is
declared by that particular syntax, and it should be different to when
a function is created outside the class definition and added as a
method to the object at run-time.

Thus breaking not only "explicit is better than implicit", but also
"special cases aren't special enough to break the rules".

Still -1.

-- 
 \     "The cost of a thing is the amount of what I call life which is |
  `\       required to be exchanged for it, immediately or in the long |
_o__)                                    run."  -- Henry David Thoreau |
Ben Finney




More information about the Python-list mailing list