Repository navigation
Suggest close-proximity property names on invalid Artist property - #32612
adambernier wants to merge 3 commits into
Conversation
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
PR summary
Instead of silently failing, as raised in pandas-dev/pandas#72090, suggest close-proximity property names using
difflib.get_close_matchesThese changes have virtually zero impact on Matplotlib's public API:
• No public API or signature changes
• Zero overhead on valid calls: lazy import of difflib only if an invalid property is passed
• Backward-compatible error: The same
AttributeError(..., name=k)type,.nameattribute, and existing message prefix are preserved, with only an optional: "Did you mean 'color'?" suffix appended when a close match is found e.g. "colour"Closes #32611
AI Disclosure
Gemini Hydrogen was used to explore the issue, suggest the changes to make, & determine where the changes should be made
PR quality check