Fix type hints for undeprecated contour APIs · matplotlib/matplotlib@6e4043b · GitHub
Skip to content

Commit 6e4043b

Browse files
committed
Fix type hints for undeprecated contour APIs
They whad been in the limbo land of deprecated APIs that I didn't bother to ensure were the _best_ type hints because they were deprecated. So I just added them to the allowlist for stubtest, but now that they are undeprecated, make sure that they are correct. While I'm here, may as well get rid of the allow list entries for all of them, even the ones that are still deprecated, as that is documented standard practice going forward that pyi match implementation for deprecations as well
1 parent 3ecb148 commit 6e4043b

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 6 deletions

lib/matplotlib/contour.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ class ContourSet(ContourLabeler, Collection):
103103
clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None
104104
labelTexts: list[Text]
105105
labelCValues: list[ColorType]
106-
allkinds: list[np.ndarray]
107-
tcolors: list[tuple[float, float, float, float]]
106+
@property
107+
def tcolors(self) -> list[tuple[float, float, float, float]]: ...
108108

109109
# only for not filled
110-
tlinewidths: list[tuple[float]]
110+
@property
111+
def tlinewidths(self) -> list[tuple[float]]: ...
111112

113+
@property
114+
def allkinds(self) -> list[list[np.ndarray | None]]: ...
115+
@property
116+
def allsegs(self) -> list[list[np.ndarray]]: ...
112117
@property
113118
def alpha(self) -> float | None: ...
114119
@property

lib/matplotlib/path.pyi

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)