ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePython 2.4
Python Documentation
Language Reference
5. Expressions
5.2 Atoms
5.2.1 Identifiers (Names)
5.2.2 Literals
5.2.3 Parenthesized forms
5.2.4 List displays
5.2.5 Generator expressions
5.2.6 Dictionary displays
5.2.7 String conversions

MyASPN >> Reference >> ActivePython 2.4 >> Python Documentation >> Language Reference >> 5. Expressions >> 5.2 Atoms
ActivePython 2.4 documentation


5.2.1 Identifiers (Names)

An identifier occurring as an atom is a name. See section 4.1 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.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved