-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Conversation
@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. |
There was a problem hiding this 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.
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 |
Fixes #7961. Adds an additional exception to the exception chain when calling the object method fails (only for object inner loops).