Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 45499:18fed14b06b6 legacy-trunk
Add a little info to the 3k deprecation warnings about what to use instead.
Suggested by Raymond Hettinger.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 24 Feb 2008 02:40:58 +0000 |
| parents | 002a5ac792b1 |
| children | 5c0b5cabeec9 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Sun Feb 24 02:39:15 2008 +0000 +++ b/Python/bltinmodule.c Sun Feb 24 02:40:58 2008 +0000 @@ -166,7 +166,7 @@ if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning, - "apply() not supported in 3.x") < 0) + "apply() not supported in 3.x. Use func(*args, **kwargs).") < 0) return NULL; if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict)) @@ -225,7 +225,7 @@ { if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning, - "callable() not supported in 3.x") < 0) + "callable() not supported in 3.x. Use hasattr(o, '__call__').") < 0) return NULL; return PyBool_FromLong((long)PyCallable_Check(v)); } @@ -684,7 +684,7 @@ if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning, - "execfile() not supported in 3.x") < 0) + "execfile() not supported in 3.x. Use exec().") < 0) return NULL; if (!PyArg_ParseTuple(args, "s|O!O:execfile", @@ -912,7 +912,7 @@ if (func == Py_None) { if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning, - "map(None, ...) not supported in 3.x") < 0) + "map(None, ...) not supported in 3.x. Use list(...).") < 0) return NULL; if (n == 1) { /* map(None, S) is the same as list(S). */
