@@ -39,6 +39,7 @@ import contextlib
3939from packaging .version import Version
4040
4141from matplotlib ._api import MatplotlibDeprecationWarning
42+ from matplotlib .typing import RcKeyType , RcGroupKeyType
4243from typing import Any , Literal , NamedTuple , overload
4344from matplotlib .typing import LogLevel
4445
@@ -69,18 +70,18 @@ def get_cachedir() -> str: ...
6970def get_data_path () -> str : ...
7071def matplotlib_fname () -> str : ...
7172
72- class RcParams (dict [str , Any ]):
73+ class RcParams (dict [RcKeyType , Any ]):
7374 validate : dict [str , Callable ]
7475 def __init__ (self , * args , ** kwargs ) -> None : ...
75- def _set (self , key : str , val : Any ) -> None : ...
76- def _get (self , key : str ) -> Any : ...
76+ def _set (self , key : RcKeyType , val : Any ) -> None : ...
77+ def _get (self , key : RcKeyType ) -> Any : ...
7778
7879 def _update_raw (self , other_params : dict | RcParams ) -> None : ...
7980
8081 def _ensure_has_backend (self ) -> None : ...
81- def __setitem__ (self , key : str , val : Any ) -> None : ...
82- def __getitem__ (self , key : str ) -> Any : ...
83- def __iter__ (self ) -> Generator [str , None , None ]: ...
82+ def __setitem__ (self , key : RcKeyType , val : Any ) -> None : ...
83+ def __getitem__ (self , key : RcKeyType ) -> Any : ...
84+ def __iter__ (self ) -> Generator [RcKeyType , None , None ]: ...
8485 def __len__ (self ) -> int : ...
8586 def find_all (self , pattern : str ) -> RcParams : ...
8687 def copy (self ) -> RcParams : ...
@@ -95,17 +96,17 @@ def rc_params_from_file(
9596rcParamsDefault : RcParams
9697rcParams : RcParams
9798rcParamsOrig : RcParams
98- defaultParams : dict [str , Any ]
99+ defaultParams : dict [RcKeyType , Any ]
99100
100- def rc (group : str , ** kwargs ) -> None : ...
101+ def rc (group : RcGroupKeyType , ** kwargs ) -> None : ...
101102def rcdefaults () -> None : ...
102103def rc_file_defaults () -> None : ...
103104def rc_file (
104105 fname : str | Path | os .PathLike , * , use_default_template : bool = ...
105106) -> None : ...
106107@contextlib .contextmanager
107108def rc_context (
108- rc : dict [str , Any ] | None = ..., fname : str | Path | os .PathLike | None = ...
109+ rc : dict [RcKeyType , Any ] | None = ..., fname : str | Path | os .PathLike | None = ...
109110) -> Generator [None , None , None ]: ...
110111def use (backend : str , * , force : bool = ...) -> None : ...
111112@overload
0 commit comments