summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-07-23 15:45:45 -0600
committerAaron Meurer <asmeurer@gmail.com>2021-07-23 15:45:45 -0600
commit5882962a6b7bc684c86a37b010403ee1908d57bd (patch)
treee8aa8711f4ead55636a2d0fe17ca6211e044f9df /numpy
parent65ed981e94b166f2fb87f1239308f4b01897e617 (diff)
downloadnumpy-5882962a6b7bc684c86a37b010403ee1908d57bd.tar.gz
Assume the current array API version is 2021.<something>
See https://github.com/numpy/numpy/pull/18585#discussion_r675849149.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/_array_api/_array_object.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/_array_api/_array_object.py b/numpy/_array_api/_array_object.py
index 13b093f4f..3ff845dd7 100644
--- a/numpy/_array_api/_array_object.py
+++ b/numpy/_array_api/_array_object.py
@@ -345,8 +345,8 @@ class Array:
return self.__class__._new(res)
def __array_namespace__(self: Array, /, *, api_version: Optional[str] = None) -> object:
- if api_version is not None:
- raise ValueError("Unrecognized array API version")
+ if api_version is not None and not api_version.startswith('2021.'):
+ raise ValueError(f"Unrecognized array API version: {api_version!r}")
from numpy import _array_api
return _array_api