Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77c4fd0

Browse files
committed
note mutating tp_dict is bad (closes #12719)
1 parent da3f4ae commit 77c4fd0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,11 @@ type objects) *must* have the :attr:`ob_size` field.
745745
This field is not inherited by subtypes (though the attributes defined in here
746746
are inherited through a different mechanism).
747747

748+
.. warning::
749+
750+
It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify
751+
:attr:`tp_dict` with the dictionary C-API.
752+
748753

749754
.. c:member:: descrgetfunc PyTypeObject.tp_descr_get
750755

0 commit comments

Comments
 (0)