mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Document which part of the random module module are guaranteed.
This commit is contained in:
parent
616453c199
commit
435cb0f233
2 changed files with 21 additions and 0 deletions
|
|
@ -270,3 +270,19 @@ Examples of basic usage::
|
||||||
<http://code.activestate.com/recipes/576707/>`_ for a compatible alternative
|
<http://code.activestate.com/recipes/576707/>`_ for a compatible alternative
|
||||||
random number generator with a long period and comparatively simple update
|
random number generator with a long period and comparatively simple update
|
||||||
operations.
|
operations.
|
||||||
|
|
||||||
|
Notes on Reproducibility
|
||||||
|
========================
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
* If a new seeding method is added, then a backward compatible seeder will be
|
||||||
|
offered.
|
||||||
|
|
||||||
|
* The generator's :meth:`random` method will continue to produce the same
|
||||||
|
sequence when the compatible seeder is given the same seed.
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Updates to the random module:
|
||||||
|
|
||||||
|
* Document which parts of the module are guaranteed to stay the same
|
||||||
|
across versions and which parts are subject to change.
|
||||||
|
|
||||||
- collections.OrderedDict now supports a new method for repositioning
|
- collections.OrderedDict now supports a new method for repositioning
|
||||||
keys to either end.
|
keys to either end.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue