2525from zarr .storage ._utils import normalize_path
2626from zarr .types import AnyArray
2727
28+ TrueOrFalse = Literal [True , False ]
29+
2830# Copied from Xarray
2931_attr_keys = st .text (st .characters (), min_size = 1 )
3032_attr_values = st .recursive (
@@ -131,7 +133,7 @@ def array_metadata(
131133 draw : st .DrawFn ,
132134 * ,
133135 array_shapes : Callable [..., st .SearchStrategy [tuple [int , ...]]] = npst .array_shapes ,
134- zarr_formats : st .SearchStrategy [Literal [ 2 , 3 ] ] = zarr_formats ,
136+ zarr_formats : st .SearchStrategy [ZarrFormat ] = zarr_formats ,
135137 attributes : SearchStrategy [Mapping [str , JSON ] | None ] = attrs ,
136138) -> ArrayV2Metadata | ArrayV3Metadata :
137139 zarr_format = draw (zarr_formats )
@@ -348,8 +350,8 @@ def basic_indices(
348350 shape : tuple [int , ...],
349351 min_dims : int = 0 ,
350352 max_dims : int | None = None ,
351- allow_newaxis : bool = False ,
352- allow_ellipsis : bool = True ,
353+ allow_newaxis : TrueOrFalse = False ,
354+ allow_ellipsis : TrueOrFalse = True ,
353355) -> Any :
354356 """Basic indices without unsupported negative slices."""
355357 strategy = npst .basic_indices (
@@ -362,7 +364,7 @@ def basic_indices(
362364 lambda idxr : (
363365 not (
364366 is_negative_slice (idxr )
365- or (isinstance (idxr , tuple ) and any (is_negative_slice (idx ) for idx in idxr )) # type: ignore[redundant-expr]
367+ or (isinstance (idxr , tuple ) and any (is_negative_slice (idx ) for idx in idxr ))
366368 )
367369 )
368370 )
0 commit comments