Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9f2c00

Browse files
committed
Merged revisions 74412 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r74412 | georg.brandl | 2009-08-13 14:58:30 +0200 (Do, 13 Aug 2009) | 9 lines Merged revisions 74411 via svnmerge from svn+ssh://[email protected]/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. ........ ................
1 parent b75111c commit f9f2c00

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Doc/tutorial/classes.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,8 @@ such a mechanism, called :dfn:`name mangling`. Any identifier of the form
592592
``__spam`` (at least two leading underscores, at most one trailing underscore)
593593
is textually replaced with ``_classname__spam``, where ``classname`` is the
594594
current class name with leading underscore(s) stripped. This mangling is done
595-
without regard to the syntactic position of the identifier, so it can be used to
596-
define class-private instance and class variables, methods, variables stored in
597-
globals, and even variables stored in instances. Truncation may occur when the
598-
mangled name would be longer than 255 characters. Outside classes, or when the
599-
class name consists of only underscores, no mangling occurs.
595+
without regard to the syntactic position of the identifier, as long as it
596+
occurs within the definition of a class.
600597

601598
Note that the mangling rules are designed mostly to avoid accidents; it still is
602599
possible to access or modify a variable that is considered private. This can

0 commit comments

Comments
 (0)