8000 MAINT: Make the refactor suggested in prepare_index by eric-wieser · Pull Request #8278 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Make the refactor suggested in prepare_index #8278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 18, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! MAINT: Improve comments, simplify handling of tuple subclasses
  • Loading branch information
eric-wieser committed Jul 16, 2017
commit c5879638a381380b7b88c00992983fbbf08baab1
6 changes: 4 additions & 2 deletions numpy/core/src/multiarray/mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ unpack_indices(PyObject *index, PyObject **result, npy_intp result_n)
if (tup == NULL) {
return -1;
}
return unpack_tuple(tup, result, result_n);
n = unpack_tuple(tup, result, result_n);
Py_DECREF(tup);
return n;
}

/*
Expand Down Expand Up @@ -368,7 +370,7 @@ prepare_index(PyArrayObject *self, PyObject *index,
int index_type = 0;
int ellipsis_pos = -1;

/*
/*
* The choice of only unpacking `2*NPY_MAXDIMS` items is historic.
* The longest "reasonable" index that produces a result of <= 32 dimensions
* is `(0,)*np.MAXDIMS + (None,)*np.MAXDIMS`. Longer indices can exist, but
Expand Down
0