[Python-checkins] r74411 - python/trunk/Doc/tutorial/classes.rst
georg.brandl
python-checkins at python.org
Thu Aug 13 14:57:25 CEST 2009
Author: georg.brandl
Date: Thu Aug 13 14:57:25 2009
New Revision: 74411
Log:
Remove potentially confusing sentence in __mangling description.
Modified:
python/trunk/Doc/tutorial/classes.rst
Modified: python/trunk/Doc/tutorial/classes.rst
==============================================================================
--- python/trunk/Doc/tutorial/classes.rst (original)
+++ python/trunk/Doc/tutorial/classes.rst Thu Aug 13 14:57:25 2009
@@ -549,11 +549,8 @@
``__spam`` (at least two leading underscores, at most one trailing underscore)
is textually replaced with ``_classname__spam``, where ``classname`` is the
current class name with leading underscore(s) stripped. This mangling is done
-without regard to the syntactic position of the identifier, so it can be used to
-define class-private instance and class variables, methods, variables stored in
-globals, and even variables stored in instances. Truncation may occur when the
-mangled name would be longer than 255 characters. Outside classes, or when the
-class name consists of only underscores, no mangling occurs.
+without regard to the syntactic position of the identifier, as long as it
+occurs within the definition of a class.
Note that the mangling rules are designed mostly to avoid accidents; it still is
possible to access or modify a variable that is considered private. This can
More information about the Python-checkins
mailing list