We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following the docs on Spines, specifically this pattern:
spines[:].set_visible(False)
leads to a mypy error:
mypy
error: No overload variant of "__getitem__" of "Spines" matches argument type "slice" [call-overload] note: Possible overload variants: note: def __getitem__(self, str, /) -> Spine note: def __getitem__(self, list[str], /) -> SpinesProxy
import matplotlib.pyplot as plt ax = plt.gca() ax.spines[:].set_visible(False)
mypy passes the above code as correctly typed.
Fix would likely be to define an overload for a slice type here:
slice
matplotlib/lib/matplotlib/spines.pyi
Line 69 in 258dd85
No response
3.8.0
None
The text was updated successfully, but these errors were encountered:
Add overload for slice to Spines.__getitem__
606925a
Closes matplotlib#26808
Successfully merging a pull request may close this issue.
Bug summary
Following the docs on Spines, specifically this pattern:
leads to a
mypy
error:Code for reproduction
Actual outcome
Expected outcome
mypy
passes the above code as correctly typed.Fix would likely be to define an overload for a
slice
type here:matplotlib/lib/matplotlib/spines.pyi
Line 69 in 258dd85
Additional information
No response
Operating system
No response
Matplotlib Version
3.8.0
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: