diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-08-18 13:18:16 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-08-18 13:18:16 (GMT) |
commit | 7a70a3a6f4a8a010d85fabf5c479cf92296d8056 (patch) | |
tree | 1622b0f8545bc5234a55dde9682cfdc7f8c19f2b /Doc/c-api/object.rst | |
parent | 36f4952404e05ac550e33c8ba2fde831fde8fecd (diff) | |
download | cpython-7a70a3a6f4a8a010d85fabf5c479cf92296d8056.zip cpython-7a70a3a6f4a8a010d85fabf5c479cf92296d8056.tar.gz cpython-7a70a3a6f4a8a010d85fabf5c479cf92296d8056.tar.bz2 |
Merged revisions 65810 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65810 | nick.coghlan | 2008-08-18 23:14:22 +1000 (Mon, 18 Aug 2008) | 1 line
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 f377c75..9851825 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -257,6 +257,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. |