From 424188a088b1a340a3e316b7244c650b6f9e5ff3 Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Tue, 12 May 2026 22:03:04 +0800 Subject: [PATCH 1/3] Add __hash__ to core.types.Lock protocol --- xarray/core/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xarray/core/types.py b/xarray/core/types.py index 69cee210798..2d86018767b 100644 --- a/xarray/core/types.py +++ b/xarray/core/types.py @@ -379,3 +379,4 @@ def acquire(self, *args, **kwargs) -> Any: ... def release(self) -> None: ... def __enter__(self) -> Any: ... def __exit__(self, *args, **kwargs) -> None: ... + def __hash__(self) -> int: ... From 4e5d7325665afd5098a8eeee3f021d28e474147c Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Tue, 12 May 2026 22:13:39 +0800 Subject: [PATCH 2/3] Implement hash in `Lock` protocol --- xarray/core/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/types.py b/xarray/core/types.py index 2d86018767b..701f4c05dab 100644 --- a/xarray/core/types.py +++ b/xarray/core/types.py @@ -379,4 +379,4 @@ def acquire(self, *args, **kwargs) -> Any: ... def release(self) -> None: ... def __enter__(self) -> Any: ... def __exit__(self, *args, **kwargs) -> None: ... - def __hash__(self) -> int: ... + def __hash__(self) -> int: return super().__hash__() From 04d8f655534679c35d0dfafc5480505bf544a341 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 14:14:08 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/core/types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xarray/core/types.py b/xarray/core/types.py index 701f4c05dab..7d1b0d07d90 100644 --- a/xarray/core/types.py +++ b/xarray/core/types.py @@ -379,4 +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__() + def __hash__(self) -> int: + return super().__hash__()