8000 ENH: initial implementation of core `__array_function__` machinery by shoyer · Pull Request #12005 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: initial implementation of core __array_function__ machinery #12005

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 13 commits into from
Sep 24, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comment on subclasses ordering
  • Loading branch information
shoyer committed Sep 24, 2018
commit ac2e2f3cb3c2f6fb8424abc48a9509d32011360d
3 changes: 3 additions & 0 deletions numpy/core/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def get_overloaded_types_and_args(relevant_args):
overloaded_types.append(arg_type)

if array_function is not ndarray.__array_function__:
# By default, insert this argument at the end, but if it is
# subclass of another argument, insert it before that argument.
# This ensures "subclasses before superclasses".
index = len(overloaded_args)
for i, old_arg in enumerate(overloaded_args):
if issubclass(arg_type, type(old_arg)):
Expand Down
0