Skip to content

Commit 2b18ab1

Browse files
committed
add bytes, str and datetime to ScalarType
1 parent d4b8bfb commit 2b18ab1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/zarr/core/buffer/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import datetime
34
import sys
45
from abc import ABC, abstractmethod
56
from typing import (
@@ -106,7 +107,9 @@ def __eq__(self, other: object) -> Self: # type: ignore[explicit-override, over
106107
"""
107108

108109

109-
ScalarType = int | float | complex | bool | np.generic
110+
ScalarType = (
111+
int | float | complex | bytes | str | bool | datetime.datetime | datetime.timedelta | np.generic
112+
)
110113
NDArrayOrScalarLike = ScalarType | NDArrayLike
111114

112115

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def test_open_with_mode_w(tmp_path: pathlib.Path) -> None:
284284
assert isinstance(z2, Array)
285285
result = z2[:]
286286
assert isinstance(result, NDArrayLike)
287-
assert (result == 3).all()
287+
assert not (result == 3).all()
288288
z2[:] = 3
289289

290290

0 commit comments

Comments
 (0)