When making use of del in a Python function, I'm getting false positives from PyFlakes telling me that the variable is undefined.
def foo(bar):
# what if it's ham? eww
if bar == 'ham':
del bar
return
# otherwise yummy!
print bar
The above function will return the following error:
C:\temp\test.py:7: undefined name 'bar'
Even though the function will work. Does anyone know of a patch to tweak the ast tree parsing to change how it's being handled? If this something others have run into?