diff options
author | Georg Brandl <georg@python.org> | 2008-03-28 12:22:12 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-28 12:22:12 (GMT) |
commit | 8ca6c84b6f8a6cd0c76db8937d471bddb4bf2a1d (patch) | |
tree | 891c59c1df48332b3927d78f0295f19fb9954f81 /Doc/c-api/mapping.rst | |
parent | fc8eef3c78200593c9c70974e48ab859779c607a (diff) | |
download | cpython-8ca6c84b6f8a6cd0c76db8937d471bddb4bf2a1d.zip cpython-8ca6c84b6f8a6cd0c76db8937d471bddb4bf2a1d.tar.gz cpython-8ca6c84b6f8a6cd0c76db8937d471bddb4bf2a1d.tar.bz2 |
Phase out has_key usage in the tutorial; correct docs for PyMapping_HasKey*.
Diffstat (limited to 'Doc/c-api/mapping.rst')
-rw-r--r-- | Doc/c-api/mapping.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst index 2005ce56..cff0759 100644 --- a/Doc/c-api/mapping.rst +++ b/Doc/c-api/mapping.rst @@ -36,15 +36,15 @@ Mapping Protocol .. cfunction:: int PyMapping_HasKeyString(PyObject *o, char *key) On success, return ``1`` if the mapping object has the key *key* and ``0`` - otherwise. This is equivalent to the Python expression ``o.has_key(key)``. - This function always succeeds. + otherwise. This is equivalent to ``o[key]``, returning ``True`` on success + and ``False`` on an exception. This function always succeeds. .. cfunction:: int PyMapping_HasKey(PyObject *o, PyObject *key) - Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. This - is equivalent to the Python expression ``o.has_key(key)``. This function always - succeeds. + Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. + This is equivalent to ``o[key]``, returning ``True`` on success and ``False`` + on an exception. This function always succeeds. .. cfunction:: PyObject* PyMapping_Keys(PyObject *o) |