Closed F-Depi closed 1 month ago
Pyright is working correctly here, so this isn't a bug.
This appears to be an issue in the matplotlib library. It includes an embeded stub file matplotlib/axes/_axes.pyi
that defines the Axes
class. This class definition doesn't include a __getitem__
method, nor do any of its parent classes. If you think that it should include a __getitem__
method, please report the issue to the maintainers of matplotlib
.
Ok, is there a workaround at least?
You could add a # type: ignore
or # pyright: ignore
comment to temporarily suppress the error while you're waiting for a fix from the matplotlib maintainers.
Simply attempting to access Axes items produces error complaining about getitem method not defined, but the code seems to work correctly. Here’s a snippet:
Running pyright on neovim.