gh-153374: Better way to clear name error suggestion#141389
gh-153374: Better way to clear name error suggestion#141389Locked-chess-official wants to merge 12 commits into
Conversation
|
This PR is stale because it has been open for 30 days with no activity. |
|
I propose you to open a new issue if you want to continue work on this. |
|
Yes this needs a new issue, closing for now. |
|
@StanFromIreland new issue is ready |
Documentation build overview
466 files changed ·
|
Removed unused import of _colorize module.
|
You should also probably add a regression test in case the bytecode changes again or something similar happens |
|
|
||
| def test_name_error_do_not_suggest_builtin_name_in_delete(self): | ||
| def func(): | ||
| del next |
There was a problem hiding this comment.
Thanks for adding this.
Since del next is inside a function, this raises an UnboundLocalError, not a NameError. However, your change only applies to a NameError.
In order to write an appropriate test, you need to run del next in the global scope. My guess is that you'll need to use an exec.
| actual = self.get_suggestion(func) | ||
| self.assertNotIn("Did you mean: 'anext'", actual) | ||
|
|
||
| def test_name_error_suggest_builtin_name_in_delete_if_not_delete_the_name_itself(self): |
There was a problem hiding this comment.
Not sure if these are necessary
|
You don't need to keep updating the branch |
Thanks blhsing. This way don't need to change the C code.