Commit e8b5949
committed
Improve
Mention its return type and that the value can be expected to change between
processes (hash randomization).
Why? The `hash` builtin gets reached for and used by a lot of people whether it
is the right tool or not. IDEs surface docstrings and people use pydoc and
`help(hash)`.
There are more possible caveats we could go into here such as classes
implementing their own dunder methods like `__eq__` or `__hash__` naturally
being able to violate the constraint stated in this docstring. But _that_ feels
like too much for a beginner friendly docstring.hash() builtin docstring with caveats.1 parent c7d5d1d commit e8b5949
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
1626 | | - | |
| 1626 | + | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1630 | 1633 | | |
1631 | 1634 | | |
1632 | 1635 | | |
| |||
0 commit comments