[Python-Dev] PEP 8 updates/clarifications
Nick Coghlan
ncoghlan at gmail.com
Mon Dec 12 02:16:55 CET 2005
Jim Fulton wrote:
> FWIW, as a general rule, I like using a single trailing underscore,
> especially for keywords. It allows the use of meaningful and easy
> to remember names. When the name of a variable should be "class" or
> "for" or whatever, it's easy, as a Python programmer, to remember that
> I need to add a trailing _. As a reformed abuser of single-character
> variable names, I've come to really hate abbreviations. It's not only
> easier to use unabbreviated names, it's easier to remember them when
> reading code. (Note that ease of use hinges on editors that automate
> typeing of repeated names.)
FWIW, I believe scipy uses the trailing underscore to avoid shadowing certain
builtins (type_, object_, str_, etc).
I thought it was ugly when I first encountered the convention, but the concept
is growing on me. . .
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-Dev
mailing list