This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ron_adam
Recipients belopolsky, docs@python, michael.foord, ron_adam
Date 2010-11-16.16:29:40
SpamBayes Score 1.2406883e-09
Marked as misclassified No
Message-id <1289924984.42.0.499259802885.issue10434@psf.upfronthosting.co.za>
In-reply-to
Content
You may also want to update help topics.

help("PRIVATENAMES").

Identifiers (Names)
*******************

An identifier occurring as an atom is a name.  See section
*Identifiers and keywords* for lexical definition and section *Naming
and binding* for documentation of naming and binding.

When the name is bound to an object, evaluation of the atom yields
that object. When a name is not bound, an attempt to evaluate it
raises a ``NameError`` exception.

**Private name mangling:** When an identifier that textually occurs in
a class definition begins with two or more underscore characters and
does not end in two or more underscores, it is considered a *private
name* of that class. Private names are transformed to a longer form
before code is generated for them.  The transformation inserts the
class name in front of the name, with leading underscores removed, and
a single underscore inserted in front of the class name.  For example,
the identifier ``__spam`` occurring in a class named ``Ham`` will be
transformed to ``_Ham__spam``.  This transformation is independent of
the syntactical context in which the identifier is used.  If the
transformed name is extremely long (longer than 255 characters),
implementation defined truncation may happen.  If the class name
consists only of underscores, no transformation is done.


Other topics that may be of interest.

IDENTIFIERS
NAMESPACES
PACKAGES
PRIVATENAMES
SPECIALATTRIBUTES
SPECIALIDENTIFIERS
SPECIALMETHODS
History
Date User Action Args
2010-11-16 16:29:44ron_adamsetrecipients: + ron_adam, belopolsky, michael.foord, docs@python
2010-11-16 16:29:44ron_adamsetmessageid: <1289924984.42.0.499259802885.issue10434@psf.upfronthosting.co.za>
2010-11-16 16:29:40ron_adamlinkissue10434 messages
2010-11-16 16:29:40ron_adamcreate