diff --git a/src/zarr/core/buffer/core.py b/src/zarr/core/buffer/core.py index 9ace4143f8..1367e651c3 100644 --- a/src/zarr/core/buffer/core.py +++ b/src/zarr/core/buffer/core.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime import sys from abc import ABC, abstractmethod from typing import ( @@ -106,7 +107,9 @@ def __eq__(self, other: object) -> Self: # type: ignore[explicit-override, over """ -ScalarType = int | float | complex | bool | np.generic +ScalarType = ( + int | float | complex | bytes | str | bool | datetime.datetime | datetime.timedelta | np.generic +) NDArrayOrScalarLike = ScalarType | NDArrayLike diff --git a/tests/test_api.py b/tests/test_api.py index a034409509..0e2dccd343 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -284,7 +284,7 @@ def test_open_with_mode_w(tmp_path: pathlib.Path) -> None: assert isinstance(z2, Array) result = z2[:] assert isinstance(result, NDArrayLike) - assert (result == 3).all() + assert not (result == 3).all() z2[:] = 3