diff options
Diffstat (limited to 'Objects/cellobject.c')
-rw-r--r-- | Objects/cellobject.c | 11 |
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 */ }; |