Skip to content

Commit adc4ebd

Browse files
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>
1 parent 8bb033c commit adc4ebd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

xarray/core/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,5 @@ def acquire(self, *args, **kwargs) -> Any: ...
379379
def release(self) -> None: ...
380380
def __enter__(self) -> Any: ...
381381
def __exit__(self, *args, **kwargs) -> None: ...
382+
def __hash__(self) -> int:
383+
return super().__hash__()

0 commit comments

Comments
 (0)