diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-12 19:05:36 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-12 19:05:36 (GMT) |
commit | a37430a0cec991f341ca637410371532c8e3720c (patch) | |
tree | 212f0d38dca36103e4a181f0b9504cd5f09f99d6 /Modules | |
parent | dad88dc15909843f1a9caf3edd9d0fb61f1ee0e4 (diff) | |
download | cpython-a37430a0cec991f341ca637410371532c8e3720c.zip cpython-a37430a0cec991f341ca637410371532c8e3720c.tar.gz cpython-a37430a0cec991f341ca637410371532c8e3720c.tar.bz2 |
dict.copy() rises from the ashes. Revert r60687.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_collectionsmodule.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 9cdabdf..67700de 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1186,23 +1186,13 @@ defdict_copy(defdictobject *dd) { /* This calls the object's class. That only works for subclasses whose class constructor has the same signature. Subclasses that - define a different constructor signature must override __copy__(). + define a different constructor signature must override copy(). */ return PyObject_CallFunctionObjArgs((PyObject*)Py_TYPE(dd), dd->default_factory, dd, NULL); } static PyObject * -defdict_copy_method(defdictobject *dd) -{ - if (Py_Py3kWarningFlag && - PyErr_Warn(PyExc_DeprecationWarning, - "defaultdict.copy() not supported in 3.x") < 0) - return NULL; - return defdict_copy(dd); -} - -static PyObject * defdict_reduce(defdictobject *dd) { /* __reduce__ must return a 5-tuple as follows: @@ -1251,7 +1241,7 @@ defdict_reduce(defdictobject *dd) static PyMethodDef defdict_methods[] = { {"__missing__", (PyCFunction)defdict_missing, METH_O, defdict_missing_doc}, - {"copy", (PyCFunction)defdict_copy_method, METH_NOARGS, + {"copy", (PyCFunction)defdict_copy, METH_NOARGS, defdict_copy_doc}, {"__copy__", (PyCFunction)defdict_copy, METH_NOARGS, defdict_copy_doc}, |