Closed as not planned
Description
Bug summary
We had code that did imports of Axes
and Figure
as follows:
This used to work fine with type checkers like pyright and mypy prior to matplotlib 3.8. Now the type checkers complain.
Code for reproduction
from matplotlib import pyplot as plt
plt.Axes
plt.Figure
Actual outcome
pyright reports that Axes
and Figure
are not exported from the module pyplot
Expected outcome
No typing error.
Additional information
Fix would be to do something like this in pyplot.py
from matplotlib.axes import Axes as Axes
from matploblib.figure import Figure as Figure
This came up due to our CI for pandas-stubs
that was testing typing of pandas against matplotlib imports
Operating system
Windows 10
Matplotlib Version
3.8
Matplotlib Backend
N/A
Python version
3.10
Jupyter version
N/A
Installation
pip
Metadata
Metadata
Assignees
Labels
No labels