summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2020-12-29 16:52:38 +0100
committerhippo91 <guillaume.peillex@gmail.com>2020-12-29 16:52:38 +0100
commit6c72c276a36574804f7f0f81bce720401fe14de7 (patch)
tree7512338f53717be8cdbfb72c96fac1d991e0dc49
parent0fa35ba648233ec783282c7b91f679dc87c0d334 (diff)
downloadastroid-git-6c72c276a36574804f7f0f81bce720401fe14de7.tar.gz
Add the function random that is an alias of random_sample
-rw-r--r--astroid/brain/brain_numpy_random_mtrand.py1
-rw-r--r--tests/unittest_brain_numpy_random_mtrand.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/astroid/brain/brain_numpy_random_mtrand.py b/astroid/brain/brain_numpy_random_mtrand.py
index 372cb73d..70d11ea4 100644
--- a/astroid/brain/brain_numpy_random_mtrand.py
+++ b/astroid/brain/brain_numpy_random_mtrand.py
@@ -45,6 +45,7 @@ def numpy_random_mtrand_transform():
import numpy
return numpy.ndarray((1,1))
def randn(*args): return uninferable
+ def random(size=None): return uninferable
def random_integers(low, high=None, size=None): return uninferable
def random_sample(size=None): return uninferable
def rayleigh(scale=1.0, size=None): return uninferable
diff --git a/tests/unittest_brain_numpy_random_mtrand.py b/tests/unittest_brain_numpy_random_mtrand.py
index 05b10a82..ec2bfcf7 100644
--- a/tests/unittest_brain_numpy_random_mtrand.py
+++ b/tests/unittest_brain_numpy_random_mtrand.py
@@ -56,6 +56,7 @@ class NumpyBrainRandomMtrandTest(unittest.TestCase):
"rand": (["args"], []),
"randint": (["low", "high", "size", "dtype"], [None, None, "l"]),
"randn": (["args"], []),
+ "random": (["size"], [None]),
"random_integers": (["low", "high", "size"], [None, None]),
"random_sample": (["size"], [None]),
"rayleigh": (["scale", "size"], [1.0, None]),