Skip to content

Commit 39f2b35

Browse files
committed
fix ambitious type hints
1 parent cb66c0e commit 39f2b35

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

zarr/attrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Dict
22
import warnings
3-
from collections.abc import MutableMapping
3+
from typing import MutableMapping
44

55
from zarr._storage.store import Store, StoreV3
66
from zarr.util import json_dumps

zarr/util.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def normalize_chunks(
171171

172172

173173
def normalize_dtype(
174-
dtype: Union[str, np.dtype[Any]], object_codec: Any
175-
) -> Tuple[np.dtype[Any], Any]:
174+
dtype: Union[str, np.dtype], object_codec: Any
175+
) -> Tuple[np.dtype, Any]:
176176

177177
# convenience API for object arrays
178178
if inspect.isclass(dtype):
@@ -212,8 +212,9 @@ def normalize_dtype(
212212

213213

214214
# noinspection PyTypeChecker
215+
# TODO: correctly type ellipsis
215216
def is_total_slice(
216-
item: Union["builtins.Ellipsis", slice, Tuple[Any, ...]], shape: Tuple[int]
217+
item: Union[slice, Tuple[Any, ...]], shape: Tuple[int]
217218
) -> bool:
218219
"""Determine whether `item` specifies a complete slice of array with the
219220
given `shape`. Used to optimize __setitem__ operations on the Chunk
@@ -293,7 +294,7 @@ def normalize_dimension_separator(sep: Optional[str]) -> Optional[str]:
293294
)
294295

295296

296-
def normalize_fill_value(fill_value: Any, dtype: np.dtype[Any]):
297+
def normalize_fill_value(fill_value: Any, dtype: np.dtype):
297298

298299
if fill_value is None or dtype.hasobject:
299300
# no fill value

0 commit comments

Comments
 (0)