diff options
-rw-r--r-- | numpy/core/src/multiarray/array_coercion.c | 1 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c index 22050a56f..d567ee0a4 100644 --- a/numpy/core/src/multiarray/array_coercion.c +++ b/numpy/core/src/multiarray/array_coercion.c @@ -1163,6 +1163,7 @@ PyArray_DiscoverDTypeAndShape_Recursive( * It might be nice to deprecate this? But it allows things such as * `arr1d[...] = np.array([[1,2,3,4]])` */ +// Here we check whether a copy is being made or not. Check this function. NPY_NO_EXPORT int PyArray_DiscoverDTypeAndShape( PyObject *obj, int max_dims, diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 670a51077..a125ce81f 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -1282,7 +1282,7 @@ _array_from_array_like(PyObject *op, PyErr_Clear(); } else { - tmp = _array_from_buffer_3118(memoryview); + tmp = _array_from_buffer_3118(memoryview); // Assume: never creates a copy Py_DECREF(memoryview); if (tmp == NULL) { return NULL; @@ -1324,7 +1324,7 @@ _array_from_array_like(PyObject *op, * this should be changed! */ if (!writeable && tmp == Py_NotImplemented) { - tmp = PyArray_FromArrayAttr(op, requested_dtype, context); + tmp = PyArray_FromArrayAttr(op, requested_dtype, context); // Assume: array was copied. if (tmp == NULL) { return NULL; } |