summaryrefslogtreecommitdiff
path: root/numpy/random/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random/__init__.py')
-rw-r--r--numpy/random/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 614b25a1c..388267c97 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -106,8 +106,16 @@ def __RandomState_ctor():
"""Return a RandomState instance.
This function exists solely to assist (un)pickling.
+
+ Note that the state of the RandomState returned here is irrelevant, as this function's
+ entire purpose is to return a newly allocated RandomState whose state pickle can set.
+ Consequently the RandomState returned by this function is a freshly allocated copy
+ with a seed=0.
+
+ See https://github.com/numpy/numpy/issues/4763 for a detailed discussion
+
"""
- return RandomState()
+ return RandomState(seed=0)
from numpy.testing import Tester
test = Tester().test