-
This question was raised by @shwina during an internal discussion: If I create two array objects, one from |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
In https://data-apis.org/array-api/latest/purpose_and_scope.html#out-of-scope it says: Non-goals for the API standard include: We have tended to not specify exception types and other such things that are out of scope, undefined behavior, etc. |
Beta Was this translation helpful? Give feedback.
-
We don't really require type checks of any kind anywhere. We have type hints, but no requirement that those be translated to checks at runtime. My reading of the spec is that such a thing is garbage in, garbage out. It might produce an error or it might work, and if it does work, it might be on accident. Requiring |
Beta Was this translation helpful? Give feedback.
-
I believe the question is answered and we already have text that addresses the point, quoted in italics above. So I'll close this issue. |
Beta Was this translation helpful? Give feedback.
In https://data-apis.org/array-api/latest/purpose_and_scope.html#out-of-scope it says:
Non-goals for the API standard include:
...
Making it possible to mix multiple array libraries in function calls.
Most array libraries do not know about other libraries, and the functions they implement may try to convert “foreign” input, or raise an exception. This behaviour is hard to specify; ensuring only a single array type is used is best left to the end user.
We have tended to not specify exception types and other such things that are out of scope, undefined behavior, etc.
TypeError
seems clearly the correct exception type, but I'm not sure it's a good idea to document this under the Python opera…