You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Private names in the bases of a generic class nested in a class are not mangled #162574
(<class 'dict'>,)
NameError: name '__Base' is not defined
__Base occurs textually in the definition of Outer, so it's a private name of Outer (Private name mangling), and adding [T] to the nested class shouldn't change how its bases resolve. Since gh-119311, _Py_MaybeMangle (Python/symtable.c) leaves every name in the type parameter scope of a generic class unmangled except the type parameters, so it is no longer mangled with the new class's name, but not with the enclosing class's either. The same happens for bounds and class keywords. I found it while writing a Lean spec of Python.
Activity