diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index f87f942cc76258..673314c19db512 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1623,15 +1623,18 @@ hash as builtin_hash obj: object / -Return the hash value for the given object. +Return the integer hash value for the given object within this process. Two objects that compare equal must also have the same hash value, but the -reverse is not necessarily true. +reverse is not necessarily true. Hash values may vary between Python +processes. + +This hash value is used internally by Python dict and set hash tables. [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=587834cbab541b99]*/ { Py_hash_t x; diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index f75a8d4ac0ccd4..86bf88bd7f38de 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -695,10 +695,13 @@ PyDoc_STRVAR(builtin_hash__doc__, "hash($module, obj, /)\n" "--\n" "\n" -"Return the hash value for the given object.\n" +"Return the integer hash value for the given object within this process.\n" "\n" "Two objects that compare equal must also have the same hash value, but the\n" -"reverse is not necessarily true."); +"reverse is not necessarily true. Hash values may vary between Python\n" +"processes.\n" +"\n" +"This hash value is used internally by Python dict and set hash tables."); #define BUILTIN_HASH_METHODDEF \ {"hash", (PyCFunction)builtin_hash, METH_O, builtin_hash__doc__}, @@ -1228,4 +1231,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=435d3f286a863c49 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8743b427edc26536 input=a9049054013a1b77]*/