pylance-release
pylance-release copied to clipboard
[matplotlib] Axes object missing in pyplot completion and some Axes functions too
In Pylance v2022.8.40 the completion works as good as the type stubs are. Since Pylance v2022.8.50 is probably microsoft/python-type-stubs#223 used.
# pyright: strict
from __future__ import annotations
from matplotlib import pyplot as plt, axes
def test(ax: plt.Axes) -> None: # axes.Axes
ax.get_yticks()
ax.set_xticks()
This worked until now, but now pyright is complaining:
Even if I use
axes.Axes
, the functions are still unknown.
One thing I noticed, but don't know if it's relevant, is that F12 used to lead to the .pyi
files and now seems to lead to the .py
files.
(Figure.savefig()
does not accept a Path
object as fname
, but thats not really this issue.)
Can you try pylance pre-release?
I think I has a newer version of the matplot stubs
@bschnurr, this still repros in 2022.9.11. Strangely go to definition on plt.Axes
takes me to the Axes
class. Given that, I'm not sure what the "Axes" is not a known member of module
error is all about.
Can you try pylance pre-release?
I think I has a newer version of the matplot stubs
I have tried that. It is the same in all versions I think.
@bschnurr, this still repros in 2022.9.11. Strangely go to definition on
plt.Axes
takes me to theAxes
class. Given that, I'm not sure what the"Axes" is not a known member of module
error is all about.
Yes, I have noticed this more often lately in various other places, but haven't found the time to get to the bottom of it yet. If you use matplotlib.axes.Axes
the autocompletion for the functions also works, although it is not found afterwards. It feels like there are 2 different parts.
lowercase axes
is also suspect. from matplotlib import pyplot as plt, axes
i'll take a look