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

Skip to content

ENH: chain additional exception on ufunc method lookup error #12700

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 1 commit into from
Jan 13, 2019

Conversation

mattip
Copy link
Member

@mattip mattip commented Jan 9, 2019

Fixes #7961. Adds an additional exception to the exception chain when calling the object method fails (only for object inner loops).

@mattip
Copy link
Member Author

mattip commented Jan 10, 2019

@eric-wieser's suggestion to split the lookup and call may slightly speed up the call, since it skips some CPython code connected with arg parsing for the function, which in our case is unecessary.

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think NoneType instead of None is slightly more correct, but doesn't really matter. Maybe the comment could be /* although undocumented, accept NULL for Py_None */?
I saw pytest.raises accepts a message=regular_expression, but just a note for the future.

Planning to merge (maybe with those comment/doc changes) in a while.

@eric-wieser eric-wieser merged commit 4a16f56 into numpy:master Jan 13, 2019
@eric-wieser
Copy link
Member

eric-wieser commented Jan 13, 2019

Thanks @mattip for addressing this so quickly. I imagine if we look a little further we can close a few more issues with this. Searching for AttributeError finds a reasonable set of candidates.

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