mirror of
https://github.com/python/cpython.git
synced 2025-10-03 21:55:41 +00:00
GH-106485: Handle dict subclasses correctly when dematerializing __dict__
(GH-107837)
This commit is contained in:
parent
bafedfbebd
commit
1d976b2da2
7 changed files with 169 additions and 7 deletions
|
@ -199,7 +199,7 @@ _PyDict_NotifyEvent(PyInterpreterState *interp,
|
|||
}
|
||||
|
||||
extern PyObject *_PyObject_MakeDictFromInstanceAttributes(PyObject *obj, PyDictValues *values);
|
||||
extern int _PyObject_MakeInstanceAttributesFromDict(PyObject *obj, PyDictOrValues *dorv);
|
||||
extern bool _PyObject_MakeInstanceAttributesFromDict(PyObject *obj, PyDictOrValues *dorv);
|
||||
extern PyObject *_PyDict_FromItems(
|
||||
PyObject *const *keys, Py_ssize_t keys_offset,
|
||||
PyObject *const *values, Py_ssize_t values_offset,
|
||||
|
|
|
@ -547,6 +547,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_lambda));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_listcomp));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_module));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_null));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_setcomp));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_string));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_STR(anon_unknown));
|
||||
|
|
|
@ -33,6 +33,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_STR(anon_lambda, "<lambda>")
|
||||
STRUCT_FOR_STR(anon_listcomp, "<listcomp>")
|
||||
STRUCT_FOR_STR(anon_module, "<module>")
|
||||
STRUCT_FOR_STR(anon_null, "<NULL>")
|
||||
STRUCT_FOR_STR(anon_setcomp, "<setcomp>")
|
||||
STRUCT_FOR_STR(anon_string, "<string>")
|
||||
STRUCT_FOR_STR(anon_unknown, "<unknown>")
|
||||
|
|
1
Include/internal/pycore_runtime_init_generated.h
generated
1
Include/internal/pycore_runtime_init_generated.h
generated
|
@ -539,6 +539,7 @@ extern "C" {
|
|||
INIT_STR(anon_lambda, "<lambda>"), \
|
||||
INIT_STR(anon_listcomp, "<listcomp>"), \
|
||||
INIT_STR(anon_module, "<module>"), \
|
||||
INIT_STR(anon_null, "<NULL>"), \
|
||||
INIT_STR(anon_setcomp, "<setcomp>"), \
|
||||
INIT_STR(anon_string, "<string>"), \
|
||||
INIT_STR(anon_unknown, "<unknown>"), \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue