Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Fix type annotation for Axes.get_legend() to include None#30321
New issue
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nrnavaneet commentedJul 16, 2025
@timhoffm, I've submitted the PR as per the approval. Kindly check and lmk if any changes are required. |
rcomer commentedJul 16, 2025
Thanks@nrnavaneet, the typing change seems good but the new test seems unrelated. |
nrnavaneet commentedJul 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Oh shoot ! Wrong test. I've made the changes. |
rcomer commentedJul 17, 2025
If you are using AI to help with your contributions, please check everything it produces before submitting it. See alsohttps://matplotlib.org/devdocs/devel/contribute.html#restrictions-on-generative-ai-usage I would not generally expect to see a test added with a typing change. In this case, I am in two minds whether to keep it. On one hand, test coverage is in general a good thing and this particular test is not expensive. On the other hand, the method in question is so simple that it is hard to see how it could go wrong, and there are existing tests that exercise it within |
nrnavaneet commentedJul 17, 2025
Sorry !!, Still a new contributor. Im still figuring things out. Shldve checked before committing. My bad , wont happen again. It was simple idk why i made it so complex. If u want u can discard this pr :(. |
nrnavaneet commentedJul 17, 2025
Kindly lmk how u wanna proceed. I respect any decision you make |
dstansby left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
For a simple typing change/fix, I agree that we don't need to add a test. Please could you remove the test?
nrnavaneet commentedJul 17, 2025
Ofcourse! Will do r8 away ! |
nrnavaneet commentedJul 17, 2025
Removed the test as per the suggestion. Thank you :) |
2b75c9e intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
…() to include None
…321-on-v3.10.xBackport PR#30321 on branch v3.10.x (Fix type annotation for Axes.get_legend() to include None)
Uh oh!
There was an error while loading.Please reload this page.
Summary
Updates the type annotation of Axes.get_legend() to reflect that the method may return None, improving accuracy and static type checking support.
Updates
Uses
Tests
closes#30318