obj: object
/
-Return the hash value for the given object.
+Return the integer hash value for the given object.
-Two objects that compare equal must also have the same hash value, but the
-reverse is not necessarily true.
+Two objects that compare equal must also have the same hash value, but
+the reverse is not necessarily true. Hash values may differ between
+Python processes. Not all objects are hashable; calling hash() on an
+unhashable object raises TypeError.
[clinic start generated code]*/
static PyObject *
builtin_hash(PyObject *module, PyObject *obj)
-/*[clinic end generated code: output=237668e9d7688db7 input=58c48be822bf9c54]*/
+/*[clinic end generated code: output=237668e9d7688db7 input=70a242ff65f6717c]*/
{
Py_hash_t x;
"hash($module, obj, /)\n"
"--\n"
"\n"
-"Return the hash value for the given object.\n"
+"Return the integer hash value for the given object.\n"
"\n"
-"Two objects that compare equal must also have the same hash value, but the\n"
-"reverse is not necessarily true.");
+"Two objects that compare equal must also have the same hash value, but\n"
+"the reverse is not necessarily true. Hash values may differ between\n"
+"Python processes. Not all objects are hashable; calling hash() on an\n"
+"unhashable object raises TypeError.");
#define BUILTIN_HASH_METHODDEF \
{"hash", (PyCFunction)builtin_hash, METH_O, builtin_hash__doc__},
exit:
return return_value;
}
-/*[clinic end generated code: output=1c3327da8885bb8e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f1fc836a63d89826 input=a9049054013a1b77]*/