mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-120452: improve documentation about private name mangling (#120451)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
422855ad21
commit
f4d6e45c1e
3 changed files with 69 additions and 15 deletions
|
@ -688,6 +688,11 @@ current class name with leading underscore(s) stripped. This mangling is done
|
|||
without regard to the syntactic position of the identifier, as long as it
|
||||
occurs within the definition of a class.
|
||||
|
||||
.. seealso::
|
||||
|
||||
The :ref:`private name mangling specifications <private-name-mangling>`
|
||||
for details and special cases.
|
||||
|
||||
Name mangling is helpful for letting subclasses override methods without
|
||||
breaking intraclass method calls. For example::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue