array-api
array-api copied to clipboard
Disallowed typing in `linalg.vector_norm`
Spec:
ord: int | float | ~typing.Literal[inf, -inf] = 2
ord: Union[int, float, Literal[inf, -inf]] = 2
The following are provisionally disallowed for simplicity. We can consider allowing them in the future.
- Floats: e.g. Literal[3.14]. Representing Literals of infinity or NaN in a clean way is tricky; real-world APIs are unlikely to vary their behavior based on a float parameter.
A relevant issue: https://github.com/python/typing/issues/1160
I don't know if anything can be done, and this was probably done deliberately, but useful to have an issue nonetheless.