Skip to content

Commit

Permalink
dirty workaround for mypy 1.5 error (#8142)
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Roos <[email protected]>
  • Loading branch information
benbovy and max-sixty authored Sep 7, 2023
1 parent c9946ec commit e2b6f34
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
DatetimeLike,
DatetimeUnitOptions,
Dims,
DsCompatible,
ErrorOptions,
ErrorOptionsWithWarn,
InterpOptions,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2b6f34

Please sign in to comment.