mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.13] gh-120452: improve documentation about private name mangling (GH-120451) (#121715)
gh-120452: improve documentation about private name mangling (GH-120451)
(cherry picked from commit f4d6e45c1e
)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
b9cfb812e2
commit
4af9c05e78
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