Skip to content

Commit 15ab8b8

Browse 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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/colors.pyi

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy