@@ -15,9 +15,11 @@ from .transforms import (
1515import numpy as np
1616
1717from collections .abc import Callable , Iterable
18- from typing import Any , NamedTuple , TextIO , overload
18+ from typing import Any , NamedTuple , TextIO , overload , TypeVar
1919from numpy .typing import ArrayLike
2020
21+ _T_Artist = TypeVar ("_T_Artist" , bound = Artist )
22+
2123def allow_rasterization (draw ): ...
2224
2325class _XYPair (NamedTuple ):
@@ -128,11 +130,21 @@ class Artist:
128130 def update (self , props : dict [str , Any ]) -> list [Any ]: ...
129131 def _internal_update (self , kwargs : Any ) -> list [Any ]: ...
130132 def set (self , ** kwargs : Any ) -> list [Any ]: ...
133+
134+ @overload
131135 def findobj (
132136 self ,
133- match : None | Callable [[Artist ], bool ] | type [ Artist ] = ...,
137+ match : None | Callable [[Artist ], bool ] = ...,
134138 include_self : bool = ...,
135139 ) -> list [Artist ]: ...
140+
141+ @overload
142+ def findobj (
143+ self ,
144+ match : type [_T_Artist ],
145+ include_self : bool = ...,
146+ ) -> list [_T_Artist ]: ...
147+
136148 def get_cursor_data (self , event : MouseEvent ) -> Any : ...
137149 def format_cursor_data (self , data : Any ) -> str : ...
138150 def get_mouseover (self ) -> bool : ...
0 commit comments