how to give an object as argument for a method
herrn at gmx.net
Thu Mar 7 11:18:53 CET 2002
On Thu, Mar 07, 2002 at 03:28:09PM +1300, Greg Ewing wrote:
> Marco Herrn wrote:
> > hmm, do I have to implement that in _every_ method or just in
> > methods who use the 'self' statement?
> In every method. The instance is always passed in
> as the first parameter, so there must be a parameter
> there to receive it, even if it's not used inside
> the method.
Is there a reason why this is just a convention? It seems (because it is
such a _strong_ convention) that this should be a real feature of the
language. I mean that there could be a reserved word "self" which is
there all the time, so that one doesn't hast to do this himself.
Experience is something you don't get until just after you need it.
Marco Herrn herrn at gmx.net
(GnuPG/PGP-signed and crypted mail preferred)
Key ID: 0x94620736
More information about the Python-list