gh-120452: improve documentation about private name mangling (#120451)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Bénédikt Tran 2024-07-13 16:45:18 +02:00 committed by GitHub
parent 422855ad21
commit f4d6e45c1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 69 additions and 15 deletions

View file

@ -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::