diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 999b8e42120e..6477924a27a9 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1806,7 +1806,7 @@ def subplot_mosaic( @overload def subplot_mosaic( - mosaic: list[HashableList[_T]], + mosaic: Sequence[HashableList[_T]], *, sharex: bool = ..., sharey: bool = ..., @@ -1822,7 +1822,7 @@ def subplot_mosaic( @overload def subplot_mosaic( - mosaic: list[HashableList[Hashable]], + mosaic: Sequence[HashableList[Hashable]], *, sharex: bool = ..., sharey: bool = ..., @@ -1837,7 +1837,7 @@ def subplot_mosaic( def subplot_mosaic( - mosaic: str | list[HashableList[_T]] | list[HashableList[Hashable]], + mosaic: str | Sequence[HashableList[_T]] | Sequence[HashableList[Hashable]], *, sharex: bool = False, sharey: bool = False, diff --git a/lib/matplotlib/typing.py b/lib/matplotlib/typing.py index e29b08b437d6..cb5aab456e2a 100644 --- a/lib/matplotlib/typing.py +++ b/lib/matplotlib/typing.py @@ -78,5 +78,5 @@ ) _HT = TypeVar("_HT", bound=Hashable) -HashableList: TypeAlias = list[_HT | "HashableList[_HT]"] +HashableList: TypeAlias = Sequence[_HT | "HashableList[_HT]"] """A nested list of Hashable values."""