-
Notifications
You must be signed in to change notification settings - Fork 44
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
indexing: require [()]
to be a no-op for all ranks?
#833
Comments
The reason is the later bullet point:
Where "should" is "must" for users and no recommendation at all for implementors, IMO. |
Right, but then my question is why does it not read: "Except in the case of providing a single ellipsis or an empty tuple (e.g. ...) ..." Do any of the array libraries have different behaviour for an empty tuple? |
OK, I am not sure I understand the point. I would agree that there is nothing special at all about 0-D. I.e. to me the whole bullet point only serves to clarify the empty tuple case because intuition seems to sometimees lead astray for such cases. I suspect you are right, it something could be clearer, but I am not sure what :). |
This arises from SciPy where (for BC) we still need to get NumPy scalars in array API compatible code, in both the production code and the tests. The only library that seems to complain about Unless I am missing a reasonable alternative interpretation of |
OK, then the question is if one should abandon disallowing partial indices, for the sake of saving you the |
Yeah, perhaps the practical solution is to add a |
FWIW, I was never a fan of the "all axes should be indexed" rule and feel that it leads to unnecessary verbosity for common indexing operations. |
The standard says:
Why is this restricted to rank
0
? Sure, a reason for the inclusion is probably to be explicit about the divergence from NumPy, but am I missing something about rank0
being special from the standard's perspective? Since[()]
must act like[...]
in the 0D case, should it not always act like that, for consistency?The text was updated successfully, but these errors were encountered: