Skip to content

Commit 35c67eb

Browse files
Apply ruff/flake8-pyi rule PYI032
PYI032 Prefer `object` to `Any` for the second parameter to `__eq__`
1 parent 6b6cecd commit 35c67eb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/zarr/core/buffer/core.py

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

9494
def all(self) -> bool: ...
9595

96-
def __eq__(self, other: Any) -> Self: # type: ignore[explicit-override, override]
96+
def __eq__(self, other: object) -> Self: # type: ignore[explicit-override, override]
9797
"""Element-wise equal
9898
9999
Notes

src/zarr/store/common.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class StorePath:
3232
path: str
3333

3434
def __init__(self, store: Store, path: str | None = None):
35-
self.store = store
36-
self.path = path or ""
35+
self.store: Store = store
36+
self.path: str = path or ""
3737

3838
async def get(
3939
self,
@@ -64,10 +64,9 @@ def __str__(self) -> str:
6464
def __repr__(self) -> str:
6565
return f"StorePath({self.store.__class__.__name__}, {str(self)!r})"
6666

67-
def __eq__(self, other: Any) -> bool:
67+
def __eq__(self, other: object) -> bool:
6868
try:
69-
if self.store == other.store and self.path == other.path:
70-
return True
69+
return bool(self.store == other.store and self.path == other.path) # type: ignore[attr-defined]
7170
except Exception:
7271
pass
7372
return False

0 commit comments

Comments
 (0)