Skip to content

Commit c395f45

Browse files
authored
Document _PyObject_GetDictPtr (#13)
1 parent 28097db commit c395f45

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/c-api/object.rst

+10
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ Object Protocol
137137
.. versionadded:: 3.3
138138
139139
140+
.. c:function:: PyObject** _PyObject_GetDictPtr(PyObject *obj)
141+
142+
Return a pointer to :py:attr:`~object.__dict__` of the object *obj*.
143+
If there is no ``__dict__``, return ``NULL`` without setting an exception.
144+
145+
Calling this function` may need to allocate memory for the
146+
dictionary, so it is may be more efficient to call :c:func:`PyObject_GetAttr`
147+
when accessing an attribute on the object.
148+
149+
140150
.. c:function:: PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid)
141151
142152
Compare the values of *o1* and *o2* using the operation specified by *opid*,

0 commit comments

Comments
 (0)