Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 15ab8b8

Browse filesBrowse files
authored
Merge pull request #26528 from meeseeksmachine/auto-backport-of-pr-26504-on-v3.8.x
Backport PR #26504 on branch v3.8.x (TYP: Add overload to specify output of Colormap.__call__ when possible)
2 parents 7ecea2a + 76cb6d0 commit 15ab8b8
Copy full SHA for 15ab8b8

File tree

1 file changed

+9
-0
lines changed
Filter options

1 file changed

+9
-0
lines changed

‎lib/matplotlib/colors.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.pyi
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ class Colormap:
6969
N: int
7070
colorbar_extend: bool
7171
def __init__(self, name: str, N: int = ...) -> None: ...
72+
@overload
73+
def __call__(
74+
self, X: Sequence[float] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ...
75+
) -> np.ndarray: ...
76+
@overload
77+
def __call__(
78+
self, X: float, alpha: float | None = ..., bytes: bool = ...
79+
) -> tuple[float, float, float, float]: ...
80+
@overload
7281
def __call__(
7382
self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ...
7483
) -> tuple[float, float, float, float] | np.ndarray: ...

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.