summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-12-28 22:12:52 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-12-28 22:12:52 (GMT)
commite3f359c71c3a51f5e115c877da7572d8042c8ad7 (patch)
treebe40598d5411a753ee86dc3d6b21c67723dd4633 /Modules
parent53f2e0ad45e41c007f714e077ccf11643651ef28 (diff)
parent3f1b95b4ae0db638dd88e71e594aeb2c770c9562 (diff)
downloadcpython-e3f359c71c3a51f5e115c877da7572d8042c8ad7.zip
cpython-e3f359c71c3a51f5e115c877da7572d8042c8ad7.tar.gz
cpython-e3f359c71c3a51f5e115c877da7572d8042c8ad7.tar.bz2
Merge.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_functoolsmodule.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index fadc0a9..035d3d9 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1053,6 +1053,20 @@ lru_cache_reduce(PyObject *self, PyObject *unused)
return PyObject_GetAttrString(self, "__qualname__");
}
+static PyObject *
+lru_cache_copy(PyObject *self, PyObject *unused)
+{
+ Py_INCREF(self);
+ return self;
+}
+
+static PyObject *
+lru_cache_deepcopy(PyObject *self, PyObject *unused)
+{
+ Py_INCREF(self);
+ return self;
+}
+
static int
lru_cache_tp_traverse(lru_cache_object *self, visitproc visit, void *arg)
{
@@ -1104,6 +1118,8 @@ static PyMethodDef lru_cache_methods[] = {
{"cache_info", (PyCFunction)lru_cache_cache_info, METH_NOARGS},
{"cache_clear", (PyCFunction)lru_cache_cache_clear, METH_NOARGS},
{"__reduce__", (PyCFunction)lru_cache_reduce, METH_NOARGS},
+ {"__copy__", (PyCFunction)lru_cache_copy, METH_VARARGS},
+ {"__deepcopy__", (PyCFunction)lru_cache_deepcopy, METH_VARARGS},
{NULL}
};