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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: adding suggested names to ColormapRegistry missing key error #28115
base: main
Are you sure you want to change the base?
Conversation
difflib.get_close_match has been in the standard library from Python 2.1
(We don't have to do this now; just leaving a comment as a note.) It would be nice to be able to reuse CPython's attribute suggestions algorithm, but it looks like it's not exposed externally (other than calling excepthook and parsing stderr...); see also ipython/ipython#13445 (ipython having to reimplement it). |
Ah, I thought this was cpython's suggestion algorithm. |
Maintains the status-quo Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
For reference, cpython appears to use Levenshtein distance (python/cpython@37494b4#diff-aad873b2c81d05628e415ef526dbd8845ebe4bf85b2d9c6d83d6cdf804b6e7b7) where as It looks like I think the reasonable options are:
|
I'm leaning to
which means a bunch more work. I'll try to get back to this, but if someone wants to take this over I will not be mad! |
Would that produce better results? |
Yes, what's the difference? If difflib gives reasonable results. I would stick with that as "good enough" before writing/vendoring any additional code. |
difflib.get_close_match has been in the standard library from Python 2.1
PR summary
Make use of a function in the standard library to give suggestions for missed
PR checklist
I don't think this needs to be called out in the release notes.