[Poll] Private variables
Aahz Maruch
aahz at panix.com
Sat Sep 15 13:46:33 EDT 2001
In article <mailman.1000325655.6912.python-list at python.org>,
Tim Peters <tim.one at home.com> wrote:
>
>They serve different purposes -- a single leading underscore is merely
>advisory, while a private name is also merely advisory <wink> but
>indicates you're more serious about it. Semantically, the single
>leading underscore means nothing, so is purely convention.
That's *almost* true. The convention comes from the fact that in a
slightly different context, a single leading underscore *does* have
meaning: module attributes with a single leading underscore do not get
imported with "from foo import *". (Well, this was true until the
__all__ attribute got created, but let's not quibble.)
--
--- Aahz <*> (Copyright 2001 by aahz at pobox.com)
Hugs and backrubs -- I break Rule 6 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista
We must not let the evil of a few trample the freedoms of the many.
More information about the Python-list
mailing list