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

Samuele Pedroni Samuele Pedroni" <pedroni@inf.ethz.ch
Mon, 21 Jan 2002 14:20:15 +0100


Hi. Thanks to http://www.pythonware.com/daily/

I landed in

http://norvig.com/python/python.html

Peter Norvig is about to supply
Python versions of the algorithms with
the 2nd edition of his AI: A Modern Approach.

So far, so good. In the section about
coding convetions he says:

=A6In general, follow Guido's style conventions,
=A6but I have some quirks that I prefer (although I could be talked out o=
f them):
...
=A6* _ instead of self as first argument to methods: def f(_, x):
...

I'm perfectly aware that the 'self' thing it is just a convetion,
OTOH much of the cross-programmer readability
of code relies on such convention.

It is good, bad or irrelevant to have such
an authoritative book (although about AI not
Python directly) adopting such a line-noisy
convention?

Maybe nobody cares, but I preferred not to
let this go unnoticed. Someone who cares
could try to discuss the issue or make it
apparent to Mr. Norvig.

Opinions?

regards, Samuele Pedroni.