FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve `hash()` builtin docstring with caveats. by gpshead · Pull Request #125229 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 6 additions & 4 deletions Python/bltinmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1840,15 +1840,17 @@ hash as builtin_hash
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;

Expand Down
10 changes: 6 additions & 4 deletions Python/clinic/bltinmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

Back | FazBrowse Home | New Git URL