Skip to content

Commit eb7071c

Browse files
authored
Merge pull request #28006 from charris/backport-28003
MAINT: random: Tweak module code in mtrand.pyx to fix a Cython warning.
2 parents 42fd84c + 0d8444d commit eb7071c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numpy/random/mtrand.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,6 +4902,7 @@ def ranf(*args, **kwargs):
49024902
return _rand.random_sample(*args, **kwargs)
49034903

49044904
__all__ = [
4905+
'RandomState',
49054906
'beta',
49064907
'binomial',
49074908
'bytes',
@@ -4954,7 +4955,6 @@ __all__ = [
49544955
'wald',
49554956
'weibull',
49564957
'zipf',
4957-
'RandomState',
49584958
]
49594959

49604960
seed.__module__ = "numpy.random"
@@ -4963,7 +4963,8 @@ sample.__module__ = "numpy.random"
49634963
get_bit_generator.__module__ = "numpy.random"
49644964
set_bit_generator.__module__ = "numpy.random"
49654965

4966-
for method_name in __all__[:-1]:
4966+
# The first item in __all__ is 'RandomState', so it can be skipped here.
4967+
for method_name in __all__[1:]:
49674968
method = getattr(RandomState, method_name, None)
49684969
if method is not None:
49694970
method.__module__ = "numpy.random"

0 commit comments

Comments
 (0)