Skip to content

ENH np.asscalar passes through scalars #11856

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

Closed
wants to merge 1 commit into from
Closed

ENH np.asscalar passes through scalars #11856

wants to merge 1 commit into from

Conversation

M-Mueller
Copy link

Passing a scalar value to np.asscalar now returns the scalar instead of
raising an AttributeError. See #4701.

(Part of EuroScipPy 2018 Sprints)

Passing a scalar value to np.asscalar now returns the scalar instead of
raising an AttributeError. See #4701.
@eric-wieser
Copy link
Member

Duplicates #5126

if isscalar(a):
return a
else:
raise e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better as a bare raise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants