MAINT: Replace the `__array_namespace__` return type with `Any`
Replace `object` as it cannot be used for expressing the objects in the array namespace.
@@ -29,7 +29,7 @@ from ._dtypes import (
_dtype_categories,
)
-from typing import TYPE_CHECKING, Optional, Tuple, Union
+from typing import TYPE_CHECKING, Optional, Tuple, Union, Any
if TYPE_CHECKING:
from ._typing import PyCapsule, Device, Dtype
@@ -380,7 +380,7 @@ class Array:
def __array_namespace__(
self: Array, /, *, api_version: Optional[str] = None
- ) -> object:
+ ) -> Any:
if api_version is not None and not api_version.startswith("2021."):
raise ValueError(f"Unrecognized array API version: {api_version!r}")
return array_api
