Skip to content

Commit 76cb6d0

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #26504: TYP: Add overload to specify output of Colormap.__call__ when possible
1 parent 104b93d commit 76cb6d0

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