Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x

This commit is contained in:
Raymond Hettinger 2008-02-09 04:37:49 +00:00
parent 2e827bfdfe
commit 17a74c395e
3 changed files with 31 additions and 3 deletions

View file

@ -1528,6 +1528,10 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
static PyObject *
dict_copy(register PyDictObject *mp)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
"dict.copy() not supported in 3.x") < 0)
return NULL;
return PyDict_Copy((PyObject*)mp);
}