diff options
author | Georg Brandl <georg@python.org> | 2009-08-13 12:58:30 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-08-13 12:58:30 (GMT) |
commit | dffc1b8932d57c3a7d587b9571aac1c3a62e08f1 (patch) | |
tree | 64f4f727de77c979ce87187a1bbc8e4375ca29ee /Doc/tutorial | |
parent | 4a52a4c3bbd41aa58b45a2a8da0eaf99fd041a38 (diff) | |
download | cpython-dffc1b8932d57c3a7d587b9571aac1c3a62e08f1.zip cpython-dffc1b8932d57c3a7d587b9571aac1c3a62e08f1.tar.gz cpython-dffc1b8932d57c3a7d587b9571aac1c3a62e08f1.tar.bz2 |
Merged revisions 74411 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74411 | georg.brandl | 2009-08-13 14:57:25 +0200 (Do, 13 Aug 2009) | 2 lines
Remove potentially confusing sentence in __mangling description.
........
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/classes.rst | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index bdc49c4..7ef4153 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -592,11 +592,8 @@ such a mechanism, called :dfn:`name mangling`. Any identifier of the form ``__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 |