assert(dictptr != NULL);
dict = *dictptr;
if (dict == NULL) {
+ assert(!_PyType_HasFeature(tp, Py_TPFLAGS_MANAGED_DICT));
dictkeys_incref(cached);
- if (_PyType_HasFeature(tp, Py_TPFLAGS_MANAGED_DICT)) {
- OBJECT_STAT_INC(dict_materialized_on_request);
- }
dict = new_dict_with_shared_keys(interp, cached);
if (dict == NULL)
return -1;
goto error_check;
}
dictptr = &dorv_ptr->dict;
+ if (*dictptr == NULL) {
+ if (_PyObject_InitInlineValues(obj, tp) < 0) {
+ goto done;
+ }
+ res = _PyObject_StoreInstanceAttribute(
+ obj, _PyDictOrValues_GetValues(*dorv_ptr), name, value);
+ goto error_check;
+ }
}
else {
dictptr = _PyObject_ComputedDictPointer(obj);