diff --git a/xarray/core/common.py b/xarray/core/common.py index 6dff9cc4024..9f3c8eabf7b 100644 --- a/xarray/core/common.py +++ b/xarray/core/common.py @@ -199,6 +199,14 @@ def __iter__(self: Any) -> Iterator[Any]: raise TypeError("iteration over a 0-d array") return self._iter() + @overload + def get_axis_num(self, dim: Iterable[Hashable]) -> tuple[int, ...]: + ... + + @overload + def get_axis_num(self, dim: Hashable) -> int: + ... + def get_axis_num(self, dim: Hashable | Iterable[Hashable]) -> int | tuple[int, ...]: """Return axis number(s) corresponding to dimension(s) in this array.