Conversation
|
Inspired by https://github.com/dutc/didyoumean, which is in C, and likely too intusive, and a recent tweet. |
|
Does not work (yet) is the function itself is not in the local or global namespace. eg: |
|
Now work also (a bit) when accessing an (wrong) attribute/methods of an object.
|
|
There is a lot of research on what makes good error messages. I would hate for this to proceed too far without anyone looking at that research. |
I'm looking at what is doable. If you have any insight of regular user issues, and better error message that would be great. For now I'm still focusing on technically how we could make these heuristics easy to write. We are definitively far from actually changing how things works in Python itself. |
|
Hi, |
|
Sweet, that looks great ! I have to test that. |
Proof of concept:
See the
did you meanat the end ?English need to be better of course, and here the
one ofis extra as it finds only 1 match.Anyway I think this would be tremendously useful for beginners to have a framework where before displaying a traceback we could spice it up with potential "fixes".