Skip to content

Commit d9e1072

Browse files
Apply ruff preview rule RUF036
RUF036 `None` not at the end of the type annotation.
1 parent fcf7ee7 commit d9e1072

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/zarr/core/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ def filters(self) -> tuple[Numcodec, ...] | tuple[ArrayArrayCodec, ...]:
21192119
return self.async_array.filters
21202120

21212121
@property
2122-
def serializer(self) -> None | ArrayBytesCodec:
2122+
def serializer(self) -> ArrayBytesCodec | None:
21232123
"""
21242124
Array-to-bytes codec to use for serializing the chunks into bytes.
21252125
"""

src/zarr/core/chunk_grids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def _auto_partition(
743743
given the dtype and shard shape. Otherwise, the chunks will be returned as-is.
744744
"""
745745
if shard_shape is None:
746-
_shards_out: None | tuple[int, ...] = None
746+
_shards_out: tuple[int, ...] | None = None
747747
if chunk_shape == "auto":
748748
_chunks_out = _guess_chunks(array_shape, item_size)
749749
else:

src/zarr/testing/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def clear_store(x: Store) -> Store:
124124

125125

126126
@st.composite
127-
def dimension_names(draw: st.DrawFn, *, ndim: int | None = None) -> list[None | str] | None:
127+
def dimension_names(draw: st.DrawFn, *, ndim: int | None = None) -> list[str | None] | None:
128128
simple_text = st.text(zarr_key_chars, min_size=0)
129129
return draw(st.none() | st.lists(st.none() | simple_text, min_size=ndim, max_size=ndim)) # type: ignore[arg-type]
130130

0 commit comments

Comments
 (0)