Why 'self' ?

Erik Max Francis max at alcyone.com
Wed Oct 31 13:02:44 EST 2001


"Russell E. Owen" wrote:

> I certainly agree it's a problem. I find forgetting to include the
> "self" argument to be one of the more significant sources of error in
> my
> own coding. Aside from that, I find it confusing that the caller and
> callee argument list are different.

There is a fairly good reason why this is done.  Methods can be bound or
unbound, and having the self parameter explicit in the case of unbound
methods and implicit in the case of bound methods makes a good deal of
sense.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list