Bug report
Bug description:
When deleting a name, python will only find the name in globals and locals, no builtins. However, the suggestion generating code just combined these dict, which makes the suggestion cycle:
>>> del next
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
del next
^^^^
NameError: name 'next' is not defined. Did you mean: 'anext'?
>>> del anext
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
del anext
^^^^^
NameError: name 'anext' is not defined. Did you mean: 'next'?
According to DPO, the best way to fix this bug is using dis to analyse the last traceback to get the final operation.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
When deleting a name, python will only find the name in globals and locals, no builtins. However, the suggestion generating code just combined these dict, which makes the suggestion cycle:
According to DPO, the best way to fix this bug is using
disto analyse the last traceback to get the final operation.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs