mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Correct name mangling algorithm, and add a comment.
This commit is contained in:
parent
41eb14dffa
commit
bfa47b0725
1 changed files with 1 additions and 2 deletions
|
@ -432,10 +432,9 @@ def metaclass():
|
|||
dict["__dynamic__"] = 1
|
||||
cls = super(autosuper, metaclass).__new__(metaclass,
|
||||
name, bases, dict)
|
||||
# Name mangling for __super removes leading underscores
|
||||
while name[:1] == "_":
|
||||
name = name[1:]
|
||||
while name[-1:] == "_":
|
||||
name = name[:-1]
|
||||
if name:
|
||||
name = "_%s__super" % name
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue