Skip to content

Commit 8fca0cd

Browse files
committed
Recommend PyObject_GetDict()
1 parent 79906b5 commit 8fca0cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/c-api/object.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ Object Protocol
278278
279279
On failure, returns ``NULL`` with an exception set.
280280
281+
The :c:func:`PyObject_GetDict` function is recommended instead of using this
282+
function, since it does not raise an exception if the object has no
283+
``__dict__``.
284+
281285
.. versionadded:: 3.3
282286
283287

0 commit comments

Comments
 (0)