gh-119311: Fix name mangling with PEP 695 generic classes (#119464)

Fixes #119311. Fixes #119395.
This commit is contained in:
Jelle Zijlstra 2024-05-27 19:50:38 -07:00 committed by GitHub
parent 3e8b60905e
commit a9a74da4a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 150 additions and 14 deletions

View file

@ -81,6 +81,7 @@ typedef struct _symtable_entry {
PyObject *ste_varnames; /* list of function parameters */
PyObject *ste_children; /* list of child blocks */
PyObject *ste_directives;/* locations of global and nonlocal statements */
PyObject *ste_mangled_names; /* set of names for which mangling should be applied */
_Py_block_ty ste_type;
int ste_nested; /* true if block is nested */
unsigned ste_free : 1; /* true if block has free variables */
@ -128,6 +129,7 @@ extern PySTEntryObject* _PySymtable_Lookup(struct symtable *, void *);
extern void _PySymtable_Free(struct symtable *);
extern PyObject *_Py_MaybeMangle(PyObject *privateobj, PySTEntryObject *ste, PyObject *name);
extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
/* Flags for def-use information */