Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4167c2

Browse files
committed
MAINT: fixes from review
1 parent 576fc47 commit d4167c2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

numpy/core/src/multiarray/ctors.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,6 @@ PyArray_GetArrayParamsFromObject(PyObject *op,
18171817
if (!writeable && PySequence_Check(op)) {
18181818
int check_it, stop_at_string, stop_at_tuple;
18191819
int type_num, type;
1820-
discovered_t is_object = DISCOVERED_OK;
18211820

18221821
/*
18231822
* Determine the type, using the requested data type if
@@ -1866,6 +1865,7 @@ PyArray_GetArrayParamsFromObject(PyObject *op,
18661865
((*out_dtype)->names || (*out_dtype)->subarray));
18671866

18681867
*out_ndim = NPY_MAXDIMS;
1868+
discovered_t is_object = DISCOVERED_OK;
18691869
if (discover_dimensions(
18701870
op, out_ndim, out_dims, check_it,
18711871
stop_at_string, stop_at_tuple, &is_object) < 0) {
@@ -1883,9 +1883,8 @@ PyArray_GetArrayParamsFromObject(PyObject *op,
18831883
}
18841884
/* If object arrays are forced */
18851885
if (is_object != DISCOVERED_OK) {
1886-
if (is_object == DISCOVERED_RAGGED && requested_dtype == NULL)
1887-
{
1888-
/* 2019-Nov-1 1.18 */
1886+
if (is_object == DISCOVERED_RAGGED && requested_dtype == NULL) {
1887+
/* NumPy 1.18, 2019-11-01 */
18891888
if (DEPRECATE("Creating an ndarray with automatic object "
18901889
"dtype is deprecated, use dtype=object if you intended "
18911890
"it, otherwise specify an exact dtype") < 0)

0 commit comments

Comments
 (0)