[Python-Dev] OT: style convention: self vs. _ in new Norvig's book

Jason Orendorff jason@jorendorff.com
Mon, 21 Jan 2002 18:06:51 -0600


Peter Norvig wrote:
> Guido van Rossum wrote:
> > I hear that in the Lisp world, when someone complains about the
> > parentheses, the standard response is "once you're used to it, the
> > parentheses disappear".  So it is for Python's 'self'.  :-)
> 
> That may be a good analogy, and as I said, I'm willing to try.

It's an excellent analogy:  both statements are about 1/3 true
in my experience.  :-)

> But I still think one character is easier to ignore than four,
> and that there is no compelling argument for 'self' over '_',
> while there is a positive reason for parens (ease of automated
> parsing tools).

There is no especially compelling reason for Python to have
'self' over '_' or 'me' or '@' or ''.

However, there is a compelling reason for you to choose 'self':
"Prefer the standard to the offbeat."  --Strunk and White

## Jason Orendorff    http://www.jorendorff.com/