From 3384ab5174e7953565987eabc19c6c9337bd2949 Mon Sep 17 00:00:00 2001 From: Benoit Bovy Date: Mon, 4 Sep 2023 10:04:19 +0200 Subject: [PATCH] dirty workaround for mypy 1.5 error --- xarray/core/dataset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index f1a0cb9dc34..232da5d36dd 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -132,6 +132,7 @@ DatetimeLike, DatetimeUnitOptions, Dims, + DsCompatible, ErrorOptions, ErrorOptionsWithWarn, InterpOptions, @@ -696,6 +697,11 @@ def __init__( self._dims = dims self._indexes = indexes + # TODO: dirty workaround for mypy 1.5 error with inherited DatasetOpsMixin vs. Mapping + # related to https://github.com/python/mypy/issues/9319? + def __eq__(self: T_Dataset, other: DsCompatible) -> T_Dataset: # type: ignore[override] + return super().__eq__(other) + @classmethod def load_store(cls: type[T_Dataset], store, decoder=None) -> T_Dataset: """Create a new dataset from the contents of a backends.*DataStore