Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply ruff/flake8-pyi rule PYI032
PYI032 Prefer `object` to `Any` for the second parameter to `__eq__`
  • Loading branch information
DimitriPapadopoulos committed Sep 24, 2024
commit 58b88a12c17a07aea4b8c412b4895834f9bebdfa
2 changes: 1 addition & 1 deletion src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def ravel(self, order: Literal["K", "A", "C", "F"] = ...) -> Self: ...

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

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

Notes
Expand Down
5 changes: 2 additions & 3 deletions src/zarr/store/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return f"StorePath({self.store.__class__.__name__}, {str(self)!r})"

def __eq__(self, other: Any) -> bool:
def __eq__(self, other: object) -> bool:
try:
if self.store == other.store and self.path == other.path:
return True
return self.store == other.store and self.path == other.path # type: ignore[attr-defined, no-any-return]
except Exception:
pass
return False
Expand Down