diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index 07a625bac02fc4..0d3e3e7ee1daac 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -137,6 +137,16 @@ Object Protocol .. versionadded:: 3.3 +.. c:function:: PyObject** _PyObject_GetDictPtr(PyObject *obj) + + Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. + If there is no ``__dict__``, return ``NULL`` without setting an exception. + + Calling this function` may need to allocate memory for the + dictionary, so it is may be more efficient to call :c:func:`PyObject_GetAttr` + when accessing an attribute on the object. + + .. c:function:: PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid) Compare the values of *o1* and *o2* using the operation specified by *opid*,