Kaydet (Commit) bfa47b07 authored tarafından Guido van Rossum's avatar Guido van Rossum

Correct name mangling algorithm, and add a comment.

üst 41eb14df
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment