Issue 2235: document PyObject_HashNotImplemented

This commit is contained in:
Nick Coghlan 2008-08-18 13:14:22 +00:00
parent f70385a5c3
commit 6e8fef07e5
3 changed files with 21 additions and 0 deletions

View file

@ -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.