summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-02-24 02:40:58 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-02-24 02:40:58 (GMT)
commitb93e7d16d50a6055309d9ff4e105ade453079c41 (patch)
treeada6d8b30a5a9aa1d2f58ce9036a3a9a750e7365 /Python
parente7b53c52bbb3c52125c7b35bf9bad13f9e783443 (diff)
downloadcpython-b93e7d16d50a6055309d9ff4e105ade453079c41.zip
cpython-b93e7d16d50a6055309d9ff4e105ade453079c41.tar.gz
cpython-b93e7d16d50a6055309d9ff4e105ade453079c41.tar.bz2
Add a little info to the 3k deprecation warnings about what to use instead.
Suggested by Raymond Hettinger.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 648637d..fe5cb42 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -166,7 +166,7 @@ builtin_apply(PyObject *self, PyObject *args)
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 @@ builtin_callable(PyObject *self, PyObject *v)
{
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 @@ builtin_execfile(PyObject *self, PyObject *args)
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 @@ builtin_map(PyObject *self, PyObject *args)
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). */