Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ Sometimes it is useful to be able to reproduce the sequences given by a
pseudo-random number generator. By re-using a seed value, the same sequence should be
reproducible from run to run as long as multiple threads are not running.

Hash randomization is not affected by
the :math:`~Random.seed` method. For this reason, code that relies on such salted
hashes, e.g. the ordering of :class:`set` or :class:`dict`, might be non-reproducible,
unless hash randomization is disabled or seeded (see: :envvar:`PYTHONHASHSEED`).

Most of the random module's algorithms and seeding functions are subject to
change across Python versions, but two aspects are guaranteed not to change:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated :mod:`random` Notes on Reproducibility to mention hash randomization.