gh-150027: Avoid copying during construction of frozenset objects (GH-150028)

This commit is contained in:
Peter Bierma 2026-05-19 13:57:37 -04:00 committed by GitHub
parent 29415c071f
commit 409fa8e1f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 116 additions and 22 deletions

View file

@ -892,6 +892,7 @@ pycore_init_builtins(PyThreadState *tstate)
interp->common_consts[CONSTANT_FALSE] = Py_False;
interp->common_consts[CONSTANT_MINUS_ONE] =
(PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS - 1];
interp->common_consts[CONSTANT_BUILTIN_FROZENSET] = (PyObject *)&PyFrozenSet_Type;
for (int i = 0; i < NUM_COMMON_CONSTANTS; i++) {
assert(interp->common_consts[i] != NULL);
}