Skip to content

Commit e2b6f34

Browse files
benbovymax-sixty
andauthored
dirty workaround for mypy 1.5 error (#8142)
Co-authored-by: Maximilian Roos <[email protected]>
1 parent c9946ec commit e2b6f34

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xarray/core/dataset.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
DatetimeLike,
133133
DatetimeUnitOptions,
134134
Dims,
135+
DsCompatible,
135136
ErrorOptions,
136137
ErrorOptionsWithWarn,
137138
InterpOptions,
@@ -696,6 +697,11 @@ def __init__(
696697
self._dims = dims
697698
self._indexes = indexes
698699

700+
# TODO: dirty workaround for mypy 1.5 error with inherited DatasetOpsMixin vs. Mapping
701+
# related to https://github.com/python/mypy/issues/9319?
702+
def __eq__(self: T_Dataset, other: DsCompatible) -> T_Dataset: # type: ignore[override]
703+
return super().__eq__(other)
704+
699705
@classmethod
700706
def load_store(cls: type[T_Dataset], store, decoder=None) -> T_Dataset:
701707
"""Create a new dataset from the contents of a backends.*DataStore

0 commit comments

Comments
 (0)