From 678e3e009bb8f68c185a6d5f6716b9e1f66daa6e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 12 Sep 2026 15:10:18 +0200 Subject: [PATCH] Backport PR #32344: TYP: PieContainer does not inherit from Container (cherry picked from commit a99bc61d82b76eab80509a57e39fa20a556d1985) --- ci/mypy-stubtest-allowlist.txt | 3 +++ lib/matplotlib/container.pyi | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/mypy-stubtest-allowlist.txt b/ci/mypy-stubtest-allowlist.txt index 5bb4f0d36c5e..adce733ea011 100644 --- a/ci/mypy-stubtest-allowlist.txt +++ b/ci/mypy-stubtest-allowlist.txt @@ -55,3 +55,6 @@ matplotlib\.animation\.EventSourceProtocol # Avoid a regression in NewType handling for stubtest # https://github.com/python/mypy/issues/19877 matplotlib\.ft2font\.GlyphIndexType\.__init__ + +# getitem method only exists for 3.11 deprecation backcompatability +matplotlib.container.PieContainer.__getitem__ diff --git a/lib/matplotlib/container.pyi b/lib/matplotlib/container.pyi index 772801b16d6d..a23f8912cfd9 100644 --- a/lib/matplotlib/container.pyi +++ b/lib/matplotlib/container.pyi @@ -53,7 +53,7 @@ class ErrorbarContainer(Container): **kwargs ) -> None: ... -class PieContainer(Container): +class PieContainer: wedges: list[Wedge] def __init__( self, @@ -70,6 +70,7 @@ class PieContainer(Container): def add_texts(self, texts: list[Text], ) -> None: ... + def remove(self) -> None: ... class StemContainer(Container): markerline: Line2D