Skip to content

Commit 91a82ea

Browse files
committed
TYP: Add more types for things that are public
1 parent 34d80c3 commit 91a82ea

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lib/matplotlib/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def matplotlib_fname() -> str: ...
6868
class RcParams(dict[str, Any]):
6969
validate: dict[str, Callable]
7070
def __init__(self, *args, **kwargs) -> None: ...
71+
def _set(self, key: str, val: Any) -> None: ...
72+
def _get(self, key: str) -> Any: ...
7173
def __setitem__(self, key: str, val: Any) -> None: ...
7274
def __getitem__(self, key: str) -> Any: ...
7375
def __iter__(self) -> Generator[str, None, None]: ...

lib/matplotlib/projections/__init__.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes
2-
from .polar import PolarAxes
1+
from .geo import (
2+
AitoffAxes as AitoffAxes,
3+
HammerAxes as HammerAxes,
4+
LambertAxes as LambertAxes,
5+
MollweideAxes as MollweideAxes,
6+
)
7+
from .polar import PolarAxes as PolarAxes
38
from ..axes import Axes
49

510
class ProjectionRegistry:

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
from matplotlib.artist import Artist
7070
from matplotlib.axes import Axes
7171
from matplotlib.axes import Subplot # noqa: F401
72-
from matplotlib.projections import PolarAxes # type: ignore
72+
from matplotlib.projections import PolarAxes
7373
from matplotlib import mlab # for detrend_none, window_hanning
7474
from matplotlib.scale import get_scale_names # noqa: F401
7575

@@ -274,7 +274,7 @@ def _get_backend_mod() -> type[matplotlib.backend_bases._Backend]:
274274
# Use rcParams._get("backend") to avoid going through the fallback
275275
# logic (which will (re)import pyplot and then call switch_backend if
276276
# we need to resolve the auto sentinel)
277-
switch_backend(rcParams._get("backend")) # type: ignore[attr-defined]
277+
switch_backend(rcParams._get("backend"))
278278
return cast(type[matplotlib.backend_bases._Backend], _backend_mod)
279279

280280

@@ -2504,7 +2504,7 @@ def polar(*args, **kwargs) -> list[Line2D]:
25042504
and rcParams._get_backend_or_none() in ( # type: ignore
25052505
set(rcsetup.interactive_bk) - {'WebAgg', 'nbAgg'})
25062506
and cbook._get_running_interactive_framework()): # type: ignore
2507-
rcParams._set("backend", rcsetup._auto_backend_sentinel) # type: ignore
2507+
rcParams._set("backend", rcsetup._auto_backend_sentinel)
25082508

25092509
# fmt: on
25102510

0 commit comments

Comments
 (0)