BUG: Fixes #7395, operator.index now fails on numpy.bool_#9685
Merged
Conversation
mhvk
reviewed
Sep 14, 2017
mhvk
left a comment
Contributor
There was a problem hiding this comment.
Wondering about the one comment; less code is better...
| bool_index(PyObject *a) | ||
| { | ||
| return PyInt_FromLong(PyArrayScalar_VAL(a, Bool)); | ||
| PyErr_SetString(PyExc_TypeError, |
Contributor
There was a problem hiding this comment.
Instead of raising an error here, isn't it easier to remove this whole definition and not define (or explicitly set to NULL; not sure) PyBoolArrType_Type.tp_as_number->nb_index? (it is currently defined in L4114).
b6760ba to
94d0b68
Compare
Member
Author
|
@mhvk: Addressed. Does this want a deprecation cycle? We already hit |
Member
|
Unless this is a big bug somewhere, the default should be to go through the deprecation I think. |
94d0b68 to
04b14d6
Compare
Member
Author
|
@seberg: Changed to a deprecation |
Member
|
Fixed merge conflict and merged. Thanks Eric. |
BvB93
pushed a commit
to BvB93/numpy
that referenced
this pull request
Sep 7, 2020
It's been deprecated since numpy#9685
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of @emilienkofman's #7420, along with added test and release notes. The description from there is