Do I need "self" and "other"?

Roy Smith roy at panix.com
Fri Jun 27 22:17:46 EDT 2008


In article 
<04e2afb7-b96c-446a-816a-ffac0ea81d5b at p25g2000hsf.googlegroups.com>,
 Kurda Yon <kurdayon at yahoo.com> wrote:

> OK, I see. In the given example "self" is just a name which can be
> replace by whichever (valid) name. Is that always like that? I mean,
> does [self] have a special meaning in some cases or it is always "just
> a name like any other"?

It has absolutely no special meaning.  Use of the name "self" is pure 
convention.

> I am asking that because "self" is highlighted
> in my text editor, so I assume that it can have a special meaning.

I use emacs, and the Python mode in emacs highlights it too, as if it were 
a keyword.  But, that's just an external tool, which is free to do whatever 
it wants.



More information about the Python-list mailing list