-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyflakes doesn't properly handle del inside function definition #428
Comments
I'm working on it. |
Hanaasagi
added a commit
to Hanaasagi/pyflakes
that referenced
this issue
Sep 4, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code produces
UnboundLocalError: local variable 'a' referenced before assignment
, but pyflakes shows now errors.The reason this code raises an exception is that local variables are determined statically at compile time, not at runtime, so the
a = 2
line forcesa
to be function local inside oftest
. Thedel a
does not make it global again (it is impossible to "make a local variable global again").The text was updated successfully, but these errors were encountered: