8000 gh-120452: improve documentation about private name mangling by picnixz · Pull Request #120451 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

8000
Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/reference/expressions.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
  • Loading branch information
picnixz and JelleZijlstra authored Jul 12, 2024
commit d4a0431af9f2e9eb1eb2cd229fa6864f9f81f6ca
10 changes: 5 additions & 5 deletions Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ identifier is used but only the following private identifiers are mangled:

The transformation rule is defined as follows:

- The class name, with leading underscores removed and a single leading
underscore inserted, is inserted in front of the identifier, e.g., the
identifier ``__spam`` occurring in a class named ``Foo``, ``_Foo`` or
``__Foo`` is transformed to ``_Foo__spam``.

- If the class name consists only of underscores, the transformation is the
identity, e.g., the identifier ``__spam`` occurring in a class named ``_``
or ``__`` is left as is.

- Otherwise, the transformation inserts the class name, with leading
underscores removed and a single leading underscore inserted, in front
of the identifier, e.g., the identifier ``__spam`` occurring in a class
named ``Foo``, ``_Foo`` or ``__Foo`` is transformed to ``_Foo__spam``.

.. _atom-literals:

Literals
Expand Down
Loading
0