Skip to content

Commit

Permalink
Merge pull request matplotlib#26528 from meeseeksmachine/auto-backpor…
Browse files Browse the repository at this point in the history
…t-of-pr-26504-on-v3.8.x

Backport PR matplotlib#26504 on branch v3.8.x (TYP: Add overload to specify output of Colormap.__call__ when possible)
  • Loading branch information
QuLogic authored Aug 15, 2023
2 parents 7ecea2a + 76cb6d0 commit 15ab8b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/matplotlib/colors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ class Colormap:
N: int
colorbar_extend: bool
def __init__(self, name: str, N: int = ...) -> None: ...
@overload
def __call__(
self, X: Sequence[float] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ...
) -> np.ndarray: ...
@overload
def __call__(
self, X: float, alpha: float | None = ..., bytes: bool = ...
) -> tuple[float, float, float, float]: ...
@overload
def __call__(
self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ...
) -> tuple[float, float, float, float] | np.ndarray: ...
Expand Down

0 comments on commit 15ab8b8

Please sign in to comment.