8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
#4701
Sorry, something went wrong.
changed asscalar to pass through scalars
cc30570
removed old syntax in except clause of asscalar
525574d
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just plain old except AttributeError: will work fine, you don't make any use of e.
except AttributeError:
e
Hmm, the function is documented to work with arrays of size 1, but not with scalars. It is not clear what we should do in the case of scalars, although your fix looks as good as any. The two commits should be squashed into one.
I think it best to leave the function as is. One thing that could be done is check for array of size == 1 and raise a more informative error message, but the function is not used anywhere in numpy and not tested, so probably not very important. Straight use of a.item() might be preferable to using the function.
a.item()
The function has no test, so if you want to submit a PR with a test, that would be good.
Fixes to numpy#4701 and numpy#5126
a977598
Successfully merging this pull request may close these issues.