@@ -28,13 +28,14 @@ from matplotlib.texmanager import TexManager
2828from matplotlib .text import Text
2929from matplotlib .transforms import Affine2D , Transform , TransformedPath , Bbox
3030
31- from typing import Any , Callable , Literal , NamedTuple , Sequence , Type , TypeVar
31+ from collections .abc import Callable , Sequence
32+ from typing import Any , Literal , NamedTuple , TypeVar
3233from numpy .typing import ArrayLike
3334
3435def register_backend (
35- format : str , backend : str | Type [FigureCanvasBase ], description : str | None = ...
36+ format : str , backend : str | type [FigureCanvasBase ], description : str | None = ...
3637) -> None : ...
37- def get_registered_canvas_class (format : str ) -> Type [FigureCanvasBase ]: ...
38+ def get_registered_canvas_class (format : str ) -> type [FigureCanvasBase ]: ...
3839
3940class RendererBase :
4041 def __init__ (self ) -> None : ...
@@ -302,7 +303,7 @@ class FigureCanvasBase:
302303 required_interactive_framework : str | None
303304
304305 @_api .classproperty
305- def manager_class (cls ) -> Type [FigureManagerBase ]: ...
306+ def manager_class (cls ) -> type [FigureManagerBase ]: ...
306307 events : list [str ]
307308 fixed_dpi : None | float
308309 filetypes : dict [str , str ]
@@ -358,8 +359,8 @@ class FigureCanvasBase:
358359 @classmethod
359360 def get_default_filetype (cls ) -> str : ...
360361 def get_default_filename (self ) -> str : ...
361- T = TypeVar ("T " , bound = FigureCanvasBase )
362- def switch_backends (self , FigureCanvasClass : Type [ T ]) -> T : ...
362+ _T = TypeVar ("_T " , bound = FigureCanvasBase )
363+ def switch_backends (self , FigureCanvasClass : type [ _T ]) -> _T : ...
363364 def mpl_connect (self , s : str , func : Callable [[Event ], Any ]) -> int : ...
364365 def mpl_disconnect (self , cid : int ) -> None : ...
365366 def new_timer (
@@ -394,7 +395,7 @@ class FigureManagerBase:
394395 def __init__ (self , canvas : FigureCanvasBase , num : int | str ) -> None : ...
395396 @classmethod
396397 def create_with_canvas (
397- cls , canvas_class : Type [FigureCanvasBase ], figure : Figure , num : int | str
398+ cls , canvas_class : type [FigureCanvasBase ], figure : Figure , num : int | str
398399 ): ...
399400 @classmethod
400401 def start_main_loop (cls ) -> None : ...
@@ -475,8 +476,8 @@ class ToolContainerBase:
475476
476477class _Backend :
477478 backend_version : str
478- FigureCanvas : Type [FigureCanvasBase ]
479- FigureManager : Type [FigureManagerBase ]
479+ FigureCanvas : type [FigureCanvasBase ]
480+ FigureManager : type [FigureManagerBase ]
480481 mainloop : None | Callable [[], Any ]
481482 @classmethod
482483 def new_figure_manager (cls , num : int | str , * args , ** kwargs ): ...
@@ -487,7 +488,7 @@ class _Backend:
487488 @classmethod
488489 def show (cls , * , block : bool | None = ...) -> None : ...
489490 @staticmethod
490- def export (cls ) -> Type [_Backend ]: ...
491+ def export (cls ) -> type [_Backend ]: ...
491492
492493class ShowBase (_Backend ):
493494 def __call__ (self , block : bool | None = ...): ...
0 commit comments