From adc4ebdee1179691d2f2f61e5cb0208d3c9573ea Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Wed, 20 May 2026 22:30:24 +0800 Subject: [PATCH] Objects satisfying the `core.types.Lock` interface should also be hashable (#11333) * Add __hash__ to core.types.Lock protocol * Implement hash in `Lock` protocol * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- xarray/core/types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xarray/core/types.py b/xarray/core/types.py index 69cee210798..7d1b0d07d90 100644 --- a/xarray/core/types.py +++ b/xarray/core/types.py @@ -379,3 +379,5 @@ def acquire(self, *args, **kwargs) -> Any: ... def release(self) -> None: ... def __enter__(self) -> Any: ... def __exit__(self, *args, **kwargs) -> None: ... + def __hash__(self) -> int: + return super().__hash__()