Newbie question: what's with "self"?

Miki miki.tebeka at gmail.com
Tue Aug 8 14:25:35 EDT 2006


Hello,

> I'm new to both Python and OO programming. From looking at a number of
> code examples, the word "self" is used a lot when referring to classes.
> As such, what does "self" mean and/or do? I've read things that say
> it's a naming convention, but no-one has really spelt it out (in idiot
> form!) in a way I can understand.
Note that apart from what all the other pepole said, "self" is not a
reserved word. It's just the wide convention that we use the name
"self".

If you know C++/Java then "self" is like "this".

HTH,
Miki
http://pythonwise.blogspot.com/




More information about the Python-list mailing list