8000 Be more specific in findobj return type by ksunden · Pull Request #28031 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Be more specific in findobj return type #28031

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 1 commit into from
Apr 6, 2024
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
16 changes: 14 additions & 2 deletions lib/matplotlib/artist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ from .transforms import (
import numpy as np

from collections.abc import Callable, Iterable
from typing import Any, NamedTuple, TextIO, overload
from typing import Any, NamedTuple, TextIO, overload, TypeVar
from numpy.typing import ArrayLike

_T_Artist = TypeVar("_T_Artist", bound=Artist)

def allow_rasterization(draw): ...

class _XYPair(NamedTuple):
Expand Down Expand Up @@ -128,11 +130,21 @@ class Artist:
def update(self, props: dict[str, Any]) -> list[Any]: ...
def _internal_update(self, kwargs: Any) -> list[Any]: ...
def set(self, **kwargs: Any) -> list[Any]: ...

@overload
def findobj(
self,
match: None | Callable[[Artist], bool] | type[Artist] = ...,
match: None | Callable[[Artist], bool] = ...,
include_self: bool = ...,
) -> list[Artist]: ...

@overload
def findobj(
self,
match: type[_T_Artist],
include_self: bool = ...,
) -> list[_T_Artist]: ...

def get_cursor_data(self, event: MouseEvent) -> Any: ...
def format_cursor_data(self, data: Any) -> str: ...
def get_mouseover(self) -> bool: ...
Expand Down
0