Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint...
The C API still has PyDict_HasKey() and _HasKeyString(); not sure
if I want to change those just yet.
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 914b6d3..d6b789d 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -701,15 +701,6 @@
};
static PyObject *
-proxy_has_key(proxyobject *pp, PyObject *key)
-{
- int res = PyDict_Contains(pp->dict, key);
- if (res < 0)
- return NULL;
- return PyBool_FromLong(res);
-}
-
-static PyObject *
proxy_get(proxyobject *pp, PyObject *args)
{
PyObject *key, *def = Py_None;
@@ -761,10 +752,8 @@
}
static PyMethodDef proxy_methods[] = {
- {"has_key", (PyCFunction)proxy_has_key, METH_O,
- PyDoc_STR("D.has_key(k) -> True if D has a key k, else False")},
{"get", (PyCFunction)proxy_get, METH_VARARGS,
- PyDoc_STR("D.get(k[,d]) -> D[k] if D.has_key(k), else d."
+ PyDoc_STR("D.get(k[,d]) -> D[k] if k in D, else d."
" d defaults to None.")},
{"keys", (PyCFunction)proxy_keys, METH_NOARGS,
PyDoc_STR("D.keys() -> list of D's keys")},