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
SystemError: no locals found when a type parameter bound names a later private type parameter of a class #162597
In class C[T: __U, __U] the bound of T names the type parameter __U that comes after it. Evaluating the bound raises SystemError, while with the order reversed it gives the type parameter:
SystemError is for internal errors (SystemError). The symbol table adds a private type parameter to ste_mangled_names only when it reaches it, so the earlier bound records __U unmangled; the compiler then mangles it with the complete set (_Py_MaybeMangle), finds no symbol for _C__U and emits LOAD_NAME in the bound's function scope, which has no locals. Here the name belongs to a later type parameter; gh-162574 concerns a private name from an enclosing class. I found it while writing a Lean spec of Python.
Activity
bedevere-app commentedon Nov 25, 2026
picnixz commentedon Nov 25, 2026
cc @JelleZijlstra