summaryrefslogtreecommitdiff
path: root/Objects/cellobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/cellobject.c')
-rw-r--r--Objects/cellobject.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 9f4eddb846..6af93b0030 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -140,8 +140,17 @@ cell_get_contents(PyCellObject *op, void *closure)
return op->ob_ref;
}
+int
+cell_set_contents(PyCellObject *op, PyObject *obj)
+{
+ Py_XINCREF(obj);
+ Py_XSETREF(op->ob_ref, obj);
+ return 0;
+}
+
static PyGetSetDef cell_getsetlist[] = {
- {"cell_contents", (getter)cell_get_contents, NULL},
+ {"cell_contents", (getter)cell_get_contents,
+ (setter)cell_set_contents, NULL},
{NULL} /* sentinel */
};