summaryrefslogtreecommitdiff
path: root/numpy/random/_generator.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random/_generator.pyx')
-rw-r--r--numpy/random/_generator.pyx7
1 files changed, 2 insertions, 5 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx
index 297642940..1c4689a70 100644
--- a/numpy/random/_generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -2,7 +2,7 @@
#cython: wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3
import operator
import warnings
-from collections.abc import MutableSequence
+from collections.abc import Sequence
from cpython.pycapsule cimport PyCapsule_IsValid, PyCapsule_GetPointer
from cpython cimport (Py_INCREF, PyFloat_AsDouble)
@@ -4398,9 +4398,6 @@ cdef class Generator:
char* x_ptr
char* buf_ptr
- if isinstance(x, memoryview):
- x = np.asarray(x)
-
axis = normalize_axis_index(axis, np.ndim(x))
if type(x) is np.ndarray and x.ndim == 1 and x.size:
@@ -4443,7 +4440,7 @@ cdef class Generator:
x[i] = buf
else:
# Untyped path.
- if not isinstance(x, MutableSequence):
+ if not isinstance(x, Sequence):
# See gh-18206. We may decide to deprecate here in the future.
warnings.warn(
"`x` isn't a recognized object; `shuffle` is not guaranteed "