pyflakes
pyflakes copied to clipboard
handle del inside function definition
It will resolve #428.
a = 1
def test():
a = 2
del a
print(a)
test()
handleNodeLoad will always search the name a from function scope to module scope, even if we defined a same name in function and then delete it. We need to remember the name we deleted. Because of name shadowing, Python will not search the outer scope.
Know little about PyPy, it's behavior is different from Python :joy:
looks like new versions of pypy have different offsets, I'll make a PR to fix that -- should be unrelated to your change here 👍
Hello, are there any questions about this PR?