@@ -240,12 +240,13 @@ type objects) *must* have the :attr:`ob_size` field.
240240
241241.. c :member :: setattrfunc PyTypeObject.tp_setattr
242242
243- An optional pointer to the set-attribute-string function.
243+ An optional pointer to the function for setting and deleting attributes .
244244
245245 This field is deprecated. When it is defined, it should point to a function
246246 that acts the same as the :c:member: `~PyTypeObject.tp_setattro ` function, but taking a C string
247247 instead of a Python string object to give the attribute name. The signature is
248- the same as for :c:func: `PyObject_SetAttrString `.
248+ the same as for :c:func: `PyObject_SetAttrString `, but setting
249+ *v * to *NULL * to delete an attribute must be supported.
249250
250251 This field is inherited by subtypes together with :c:member: `~PyTypeObject.tp_setattro `: a subtype
251252 inherits both :c:member: `~PyTypeObject.tp_setattr ` and :c:member: `~PyTypeObject.tp_setattro ` from its base type when
@@ -389,9 +390,10 @@ type objects) *must* have the :attr:`ob_size` field.
389390
390391.. c :member :: setattrofunc PyTypeObject.tp_setattro
391392
392- An optional pointer to the set-attribute function.
393+ An optional pointer to the function for setting and deleting attributes .
393394
394- The signature is the same as for :c:func: `PyObject_SetAttr `. It is usually
395+ The signature is the same as for :c:func: `PyObject_SetAttr `, but setting
396+ *v * to *NULL * to delete an attribute must be supported. It is usually
395397 convenient to set this field to :c:func: `PyObject_GenericSetAttr `, which
396398 implements the normal way of setting object attributes.
397399
@@ -831,7 +833,7 @@ The next fields, up to and including :c:member:`~PyTypeObject.tp_weaklist`, only
831833 typedef struct PyGetSetDef {
832834 char *name; /* attribute name */
833835 getter get; /* C function to get the attribute */
834- setter set; /* C function to set the attribute */
836+ setter set; /* C function to set or delete the attribute */
835837 char *doc; /* optional doc string */
836838 void *closure; /* optional additional data for getter and setter */
837839 } PyGetSetDef;
@@ -877,12 +879,14 @@ The next fields, up to and including :c:member:`~PyTypeObject.tp_weaklist`, only
877879
878880.. c :member :: descrsetfunc PyTypeObject.tp_descr_set
879881
880- An optional pointer to a "descriptor set" function.
882+ An optional pointer to a function for setting and deleting
883+ a descriptor's value.
881884
882885 The function signature is ::
883886
884887 int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);
885888
889+ The *value * argument is set to *NULL * to delete the value.
886890 This field is inherited by subtypes.
887891
888892 .. XXX explain.
@@ -1263,9 +1267,11 @@ Mapping Object Structures
12631267
12641268.. c :member :: objobjargproc PyMappingMethods.mp_ass_subscript
12651269
1266- This function is used by :c:func: `PyObject_SetItem ` and has the same
1267- signature. If this slot is *NULL *, the object does not support item
1268- assignment.
1270+ This function is used by :c:func: `PyObject_SetItem ` and
1271+ :c:func: `PyObject_DelItem `. It has the same signature as
1272+ :c:func: `PyObject_SetItem `, but *v * can also be set to *NULL * to delete
1273+ an item. If this slot is *NULL *, the object does not support item
1274+ assignment and deletion.
12691275
12701276
12711277.. _sequence-structs :
@@ -1314,7 +1320,7 @@ Sequence Object Structures
13141320
13151321 This function is used by :c:func: `PySequence_SetItem ` and has the same
13161322 signature. This slot may be left to *NULL * if the object does not support
1317- item assignment.
1323+ item assignment and deletion .
13181324
13191325.. c :member :: objobjproc PySequenceMethods.sq_contains
13201326
0 commit comments