summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-25 08:29:14 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-25 08:29:14 (GMT)
commitd5b635f1969fdd609f0aff5669c9ec30e61be62e (patch)
tree1c854f8108e2b22d8c5ba4d529b6d99cd9f5f244 /Objects/dictobject.c
parent80055f6295dd48274ae68d13806c7ee3c5b5882f (diff)
downloadcpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.zip
cpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.tar.gz
cpython-d5b635f1969fdd609f0aff5669c9ec30e61be62e.tar.bz2
Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 1ca2830..b897118 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1778,8 +1778,10 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
}
else {
/* Py3K warning if comparison isn't == or != */
- if (Py_Py3kWarningFlag && PyErr_Warn(PyExc_DeprecationWarning,
- "dict inequality comparisons not supported in 3.x.") < 0) {
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "dict inequality comparisons not supported "
+ "in 3.x") < 0) {
return NULL;
}
res = Py_NotImplemented;
@@ -1811,7 +1813,8 @@ dict_has_key(register PyDictObject *mp, PyObject *key)
{
if (Py_Py3kWarningFlag &&
PyErr_Warn(PyExc_DeprecationWarning,
- "dict.has_key() not supported in 3.x") < 0)
+ "dict.has_key() not supported in 3.x; "
+ "use the in operator") < 0)
return NULL;
return dict_contains(mp, key);
}