gh-112640: Add kwdefaults parameter to types.FunctionType.__new__ (#112641)

This commit is contained in:
Nikita Sobolev 2024-01-11 11:42:30 +03:00 committed by GitHub
parent f653caa5a8
commit 2ac4cf4743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 76 additions and 13 deletions

View file

@ -1015,6 +1015,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(kw));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(kw1));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(kw2));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(kwdefaults));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(lambda));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(last));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(last_exc));

View file

@ -504,6 +504,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(kw)
STRUCT_FOR_ID(kw1)
STRUCT_FOR_ID(kw2)
STRUCT_FOR_ID(kwdefaults)
STRUCT_FOR_ID(lambda)
STRUCT_FOR_ID(last)
STRUCT_FOR_ID(last_exc)

View file

@ -1013,6 +1013,7 @@ extern "C" {
INIT_ID(kw), \
INIT_ID(kw1), \
INIT_ID(kw2), \
INIT_ID(kwdefaults), \
INIT_ID(lambda), \
INIT_ID(last), \
INIT_ID(last_exc), \

View file

@ -1353,6 +1353,9 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
string = &_Py_ID(kw2);
assert(_PyUnicode_CheckConsistency(string, 1));
_PyUnicode_InternInPlace(interp, &string);
string = &_Py_ID(kwdefaults);
assert(_PyUnicode_CheckConsistency(string, 1));
_PyUnicode_InternInPlace(interp, &string);
string = &_Py_ID(lambda);
assert(_PyUnicode_CheckConsistency(string, 1));
_PyUnicode_InternInPlace(interp, &string);