@@ -15,9 +15,11 @@ from .transforms import (
15
15
import numpy as np
16
16
17
17
from collections .abc import Callable , Iterable
18
- from typing import Any , NamedTuple , TextIO , overload
18
+ from typing import Any , NamedTuple , TextIO , overload , TypeVar
19
19
from numpy .typing import ArrayLike
20
20
21
+ _T_Artist = TypeVar ("_T_Artist" , bound = Artist )
22
+
21
23
def allow_rasterization (draw ): ...
22
24
23
25
class _XYPair (NamedTuple ):
@@ -128,11 +130,21 @@ class Artist:
128
130
def update (self , props : dict [str , Any ]) -> list [Any ]: ...
129
131
def _internal_update (self , kwargs : Any ) -> list [Any ]: ...
130
132
def set (self , ** kwargs : Any ) -> list [Any ]: ...
133
+
134
+ @overload
131
135
def findobj (
132
136
self ,
133
- match : None | Callable [[Artist ], bool ] | type [ Artist ] = ...,
137
+ match : None | Callable [[Artist ], bool ] = ...,
134
138
include_self : bool = ...,
135
139
) -> list [Artist ]: ...
140
+
141
+ @overload
142
+ def findobj (
143
+ self ,
144
+ match : type [_T_Artist ],
145
+ include_self : bool = ...,
146
+ ) -> list [_T_Artist ]: ...
147
+
136
148
def get_cursor_data (self , event : MouseEvent ) -> Any : ...
137
149
def format_cursor_data (self , data : Any ) -> str : ...
138
150
def get_mouseover (self ) -> bool : ...
0 commit comments