@@ -208,12 +208,13 @@ type objects) *must* have the :attr:`ob_size` field.
208208
209209.. c :member :: setattrfunc PyTypeObject.tp_setattr
210210
211- An optional pointer to the set-attribute-string function.
211+ An optional pointer to the function for setting and deleting attributes .
212212
213213 This field is deprecated. When it is defined, it should point to a function
214214 that acts the same as the :c:member: `~PyTypeObject.tp_setattro ` function, but taking a C string
215215 instead of a Python string object to give the attribute name. The signature is
216- the same as for :c:func: `PyObject_SetAttrString `.
216+ the same as for :c:func: `PyObject_SetAttrString `, but setting
217+ *v * to *NULL * to delete an attribute must be supported.
217218
218219 This field is inherited by subtypes together with :c:member: `~PyTypeObject.tp_setattro `: a subtype
219220 inherits both :c:member: `~PyTypeObject.tp_setattr ` and :c:member: `~PyTypeObject.tp_setattro ` from its base type when
@@ -351,9 +352,10 @@ type objects) *must* have the :attr:`ob_size` field.
351352
352353.. c :member :: setattrofunc PyTypeObject.tp_setattro
353354
354- An optional pointer to the set-attribute function.
355+ An optional pointer to the function for setting and deleting attributes .
355356
356- The signature is the same as for :c:func: `PyObject_SetAttr `. It is usually
357+ The signature is the same as for :c:func: `PyObject_SetAttr `, but setting
358+ *v * to *NULL * to delete an attribute must be supported. It is usually
357359 convenient to set this field to :c:func: `PyObject_GenericSetAttr `, which
358360 implements the normal way of setting object attributes.
359361
@@ -724,7 +726,7 @@ type objects) *must* have the :attr:`ob_size` field.
724726 typedef struct PyGetSetDef {
725727 char *name; /* attribute name */
726728 getter get; /* C function to get the attribute */
727- setter set; /* C function to set the attribute */
729+ setter set; /* C function to set or delete the attribute */
728730 char *doc; /* optional doc string */
729731 void *closure; /* optional additional data for getter and setter */
730732 } PyGetSetDef;
@@ -775,12 +777,14 @@ type objects) *must* have the :attr:`ob_size` field.
775777
776778.. c :member :: descrsetfunc PyTypeObject.tp_descr_set
777779
778- An optional pointer to a "descriptor set" function.
780+ An optional pointer to a function for setting and deleting
781+ a descriptor's value.
779782
780783 The function signature is ::
781784
782785 int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);
783786
787+ The *value * argument is set to *NULL * to delete the value.
784788 This field is inherited by subtypes.
785789
786790 .. XXX explain.
@@ -1171,9 +1175,11 @@ Mapping Object Structures
11711175
11721176.. c :member :: objobjargproc PyMappingMethods.mp_ass_subscript
11731177
1174- This function is used by :c:func: `PyObject_SetItem ` and has the same
1175- signature. If this slot is *NULL *, the object does not support item
1176- assignment.
1178+ This function is used by :c:func: `PyObject_SetItem ` and
1179+ :c:func: `PyObject_DelItem `. It has the same signature as
1180+ :c:func: `PyObject_SetItem `, but *v * can also be set to *NULL * to delete
1181+ an item. If this slot is *NULL *, the object does not support item
1182+ assignment and deletion.
11771183
11781184
11791185.. _sequence-structs :
@@ -1222,7 +1228,7 @@ Sequence Object Structures
12221228
12231229 This function is used by :c:func: `PySequence_SetItem ` and has the same
12241230 signature. This slot may be left to *NULL * if the object does not support
1225- item assignment.
1231+ item assignment and deletion .
12261232
12271233.. c :member :: objobjproc PySequenceMethods.sq_contains
12281234
0 commit comments