File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818import operator
1919from collections .abc import Iterator
2020from enum import IntEnum
21- from types import EllipsisType , ModuleType
21+ from types import ModuleType
2222from typing import Any , Literal , SupportsIndex
2323
2424import numpy as np
4242from ._flags import get_array_api_strict_flags , set_array_api_strict_flags
4343from ._typing import PyCapsule
4444
45+ try :
46+ from types import EllipsisType # Python >=3.10
47+ except ImportError :
48+ EllipsisType = type (Ellipsis )
4549
4650class Device :
4751 _device : str
@@ -345,7 +349,7 @@ def _validate_index(
345349 | tuple [int | slice | EllipsisType | None , ...]
346350 | Array
347351 ),
348- op : Literal ["getitem" , "setitem" ],
352+ op : Literal ["getitem" , "setitem" ] = "getitem" ,
349353 ) -> None :
350354 """
351355 Validate an index according to the array API.
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
13import warnings
24from typing import Any
35
Original file line number Diff line number Diff line change 11"""Private helper routines.
22"""
3+ from __future__ import annotations
34
45from ._array_object import Array
56from ._dtypes import _dtype_categories
You can’t perform that action at this time.
0 commit comments