Despite _Py_T_OBJECT being marked as deprecated in descrobject.h it is commonly used in the standard library.
LOAD_ATTR_SLOT de-optimizes if the stored value is NULL. If the stored value is not NULL, both _Py_T_OBJECT and Py_T_OBJECT_EX act the same, so we can reuse LOAD_ATTR_SLOT for _Py_T_OBJECT.
For storing attributes, _Py_T_OBJECT and Py_T_OBJECT_EX are exactly the same.
I don't know why _Py_T_OBJECT is deprecated, the semantics seem quite reasonable.
Linked PRs
Despite
_Py_T_OBJECTbeing marked as deprecated indescrobject.hit is commonly used in the standard library.LOAD_ATTR_SLOTde-optimizes if the stored value isNULL. If the stored value is notNULL, both_Py_T_OBJECTandPy_T_OBJECT_EXact the same, so we can reuseLOAD_ATTR_SLOTfor_Py_T_OBJECT.For storing attributes,
_Py_T_OBJECTandPy_T_OBJECT_EXare exactly the same.I don't know why
_Py_T_OBJECTis deprecated, the semantics seem quite reasonable.Linked PRs
_Py_T_OBJECT#111773