Trying to build an xarray Dataset, where we build the input to the arguments "coords" and "attrs" before passing it to the constructor:
coordinates = {"time": ("time", time_coordinates)}
attributes = {"some_flag": False}
...
ds = xr.Dataset(data_vars=variables, coords=coordinates, attrs=attributes)
What puzzles me is the output of mypy run against this code:
error: Argument "coords" to "Dataset" has incompatible type "Dict[str, Tuple[str, Any]]"; expected "Optional[Mapping[Hashable, Any]]"
error: Argument "attrs" to "Dataset" has incompatible type "Dict[str, bool]"; expected "Optional[Mapping[Hashable, Any]]"
Isn't a dict a Mapping? And isn't str also Hashable? And aren't Tuples and bools of type Any, in any case? What do I not understand about mypy and/or Python type hints here?