diff --git a/ci/mypy-stubtest-allowlist.txt b/ci/mypy-stubtest-allowlist.txt index e9256de10b36..9f3efd283906 100644 --- a/ci/mypy-stubtest-allowlist.txt +++ b/ci/mypy-stubtest-allowlist.txt @@ -41,12 +41,6 @@ matplotlib.figure.Figure.set_tight_layout matplotlib.cm.register_cmap matplotlib.cm.unregister_cmap -# 3.8 deprecations -matplotlib.contour.ContourSet.allkinds -matplotlib.contour.ContourSet.allsegs -matplotlib.contour.ContourSet.tcolors -matplotlib.contour.ContourSet.tlinewidths - # positional-only argument name lacking leading underscores matplotlib.axes._base._AxesBase.axis diff --git a/lib/matplotlib/contour.pyi b/lib/matplotlib/contour.pyi index 8a987b762445..d7bddfe8f1f5 100644 --- a/lib/matplotlib/contour.pyi +++ b/lib/matplotlib/contour.pyi @@ -103,12 +103,17 @@ class ContourSet(ContourLabeler, Collection): clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None labelTexts: list[Text] labelCValues: list[ColorType] - allkinds: list[np.ndarray] - tcolors: list[tuple[float, float, float, float]] + @property + def tcolors(self) -> list[tuple[tuple[float, float, float, float]]]: ... # only for not filled - tlinewidths: list[tuple[float]] + @property + def tlinewidths(self) -> list[tuple[float]]: ... + @property + def allkinds(self) -> list[list[np.ndarray | None]]: ... + @property + def allsegs(self) -> list[list[np.ndarray]]: ... @property def alpha(self) -> float | None: ... @property diff --git a/lib/matplotlib/path.pyi b/lib/matplotlib/path.pyi index c96c5a0ba9e4..464fc6d9a912 100644 --- a/lib/matplotlib/path.pyi +++ b/lib/matplotlib/path.pyi @@ -30,7 +30,7 @@ class Path: @vertices.setter def vertices(self, vertices: ArrayLike) -> None: ... @property - def codes(self) -> ArrayLike: ... + def codes(self) -> ArrayLike | None: ... @codes.setter def codes(self, codes: ArrayLike) -> None: ... @property