diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-08-18 13:14:22 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-08-18 13:14:22 (GMT) |
commit | 6e8fef07e5d1a3372d0c729c81dd383a23b053d5 (patch) | |
tree | cd7efd8b360e34c582e96cd5e05e1f9bf555dd21 /Doc/c-api/object.rst | |
parent | f70385a5c3245a9cac9c0546c65bd467a2ac5249 (diff) | |
download | cpython-6e8fef07e5d1a3372d0c729c81dd383a23b053d5.zip cpython-6e8fef07e5d1a3372d0c729c81dd383a23b053d5.tar.gz cpython-6e8fef07e5d1a3372d0c729c81dd383a23b053d5.tar.bz2 |
Issue 2235: document PyObject_HashNotImplemented
Diffstat (limited to 'Doc/c-api/object.rst')
-rw-r--r-- | Doc/c-api/object.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index 7bb845a..883d095 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -269,6 +269,16 @@ is considered sufficient for this determination. This is the equivalent of the Python expression ``hash(o)``. +.. cfunction:: long PyObject_HashNotImplemented(PyObject *o) + + Set a TypeError indicating that ``type(o)`` is not hashable and return ``-1``. + This function receives special treatment when stored in a ``tp_hash`` slot, + allowing a type to explicit indicate to the interpreter that it is not + hashable. + + .. versionadded:: 2.6 + + .. cfunction:: int PyObject_IsTrue(PyObject *o) Returns ``1`` if the object *o* is considered to be true, and ``0`` otherwise. |