From: Benjamin Peterson Date: Tue, 9 Aug 2011 21:07:01 +0000 (-0500) Subject: note mutating tp_dict is bad (closes #12719) X-Git-Tag: v3.2.2rc1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77c4fd01dd3fa9b7830ca3dcd1506565352d32f3;p=thirdparty%2FPython%2Fcpython.git note mutating tp_dict is bad (closes #12719) --- diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 4a6335c86989..68ca9adaa9b0 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -745,6 +745,11 @@ type objects) *must* have the :attr:`ob_size` field. This field is not inherited by subtypes (though the attributes defined in here are inherited through a different mechanism). + .. warning:: + + It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify + :attr:`tp_dict` with the dictionary C-API. + .. c:member:: descrgetfunc PyTypeObject.tp_descr_get