gh-139817: Attribute __qualname__ is added to TypeAliasType (#139919)

This commit is contained in:
Mikhail Efimov
2025-10-15 19:08:17 +03:00
committed by GitHub
parent 5213f1b684
commit f673f0e7b4
9 changed files with 144 additions and 33 deletions

View File

@@ -1974,6 +1974,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ps1));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ps2));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(qid));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(qualname));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(query));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(queuetype));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(quotetabs));

View File

@@ -697,6 +697,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(ps1)
STRUCT_FOR_ID(ps2)
STRUCT_FOR_ID(qid)
STRUCT_FOR_ID(qualname)
STRUCT_FOR_ID(query)
STRUCT_FOR_ID(queuetype)
STRUCT_FOR_ID(quotetabs)

View File

@@ -1972,6 +1972,7 @@ extern "C" {
INIT_ID(ps1), \
INIT_ID(ps2), \
INIT_ID(qid), \
INIT_ID(qualname), \
INIT_ID(query), \
INIT_ID(queuetype), \
INIT_ID(quotetabs), \

View File

@@ -2576,6 +2576,10 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(qualname);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(query);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));