Skip to content

Commit b9df822

Browse files
Apply ruff/flake8-pyi rule PYI032
PYI032 Prefer `object` to `Any` for the second parameter to `__eq__`
1 parent 3ad4bf2 commit b9df822

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/zarr/buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def ravel(self, order: Literal["K", "A", "C", "F"] = ...) -> Self: ...
8383

8484
def all(self) -> bool: ...
8585

86-
def __eq__(self, other: Any) -> Self: # type: ignore[explicit-override, override]
86+
def __eq__(self, other: object) -> Self: # type: ignore[explicit-override, override]
8787
"""Element-wise equal
8888
8989
Notes

src/zarr/store/core.py

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

33
from pathlib import Path
4-
from typing import TYPE_CHECKING, Any
4+
from typing import TYPE_CHECKING
55

66
from zarr.abc.store import Store
77
from zarr.buffer import Buffer, BufferPrototype, default_buffer_prototype
@@ -56,13 +56,11 @@ def __str__(self) -> str:
5656
def __repr__(self) -> str:
5757
return f"StorePath({self.store.__class__.__name__}, {str(self)!r})"
5858

59-
def __eq__(self, other: Any) -> bool:
59+
def __eq__(self, other: object) -> bool:
6060
try:
61-
if self.store == other.store and self.path == other.path:
62-
return True
61+
return bool(self.store == other.store and self.path == other.path) # type: ignore[attr-defined]
6362
except Exception:
64-
pass
65-
return False
63+
return False
6664

6765

6866
StoreLike = Store | StorePath | Path | str

0 commit comments

Comments
 (0)