Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Backport PR #26504 on branch v3.8.x (TYP: Add overload to specify output of Colormap.__call__ when possible) #26528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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