File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 18
18
import operator
19
19
from collections .abc import Iterator
20
20
from enum import IntEnum
21
- from types import EllipsisType , ModuleType
21
+ from types import ModuleType
22
22
from typing import Any , Literal , SupportsIndex
23
23
24
24
import numpy as np
42
42
from ._flags import get_array_api_strict_flags , set_array_api_strict_flags
43
43
from ._typing import PyCapsule
44
44
45
+ try :
46
+ from types import EllipsisType # Python >=3.10
47
+ except ImportError :
48
+ EllipsisType = type (Ellipsis )
45
49
46
50
class Device :
47
51
_device : str
@@ -345,7 +349,7 @@ def _validate_index(
345
349
| tuple [int | slice | EllipsisType | None , ...]
346
350
| Array
347
351
),
348
- op : Literal ["getitem" , "setitem" ],
352
+ op : Literal ["getitem" , "setitem" ] = "getitem" ,
349
353
) -> None :
350
354
"""
351
355
Validate an index according to the array API.
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
1
3
import warnings
2
4
from typing import Any
3
5
Original file line number Diff line number Diff line change 1
1
"""Private helper routines.
2
2
"""
3
+ from __future__ import annotations
3
4
4
5
from ._array_object import Array
5
6
from ._dtypes import _dtype_categories
You can’t perform that action at this time.
0 commit comments