]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] Improve `hash()` builtin docstring with caveats. (GH-125229) (#149054)
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Mon, 27 Apr 2026 16:17:30 +0000 (09:17 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Apr 2026 16:17:30 +0000 (16:17 +0000)
commitbb8d6a0863e7bf2cac519ee41ec8fa966eee08b7
treefe09a1786a377a0f8c2dc885bc234883e0c943ed
parentf9140e201c5b0372d0195ea3e289e8fa7761f78f
[3.14] Improve  `hash()` builtin docstring with caveats. (GH-125229) (#149054)

Improve  `hash()` builtin docstring with caveats.

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)`.
(cherry picked from commit 665b7dfcfa240e02760f58bed5ca29ec01d028e6)
Python/bltinmodule.c
Python/clinic/bltinmodule.c.h