-
Notifications
You must be signed in to change notification settings - Fork 206
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
N816 considers generator/list comprehensions to be globally scoped #233
Comments
So on some versions of Python (I think this was fixed ~recently) leaked the variable from the list comprehension outside of the comprehension. That may no longer be correct, but if your example is what you're checking, you would (on those versions) be leaking |
I tested this with Python 3.11.5. But which rule is supposed to catch this then if not N816? |
It would be N816 but I suspect we need to put a version cap on that , I just can't remember when the language changed such that comprehension bindings weren't leaked |
I suspect we could eliminate this behavior of the check since we no longer support the buggy versions of Python https://stackoverflow.com/a/29907448 |
I'm a bit lost here. Eliminate what behavior of the check? That it identifies mixed case variables in comprehensions? |
Can you say more about this? I'm not sure if this was ever the case unless it's a named assignment ( |
Any more input here? @sigmavirus24 @dhruvmanila |
The following will trigger N816 twice:
N816 is explained as "mixedCase variable in global scope".
But are they really globals? Should there not be a new error code Nxyz for this? Or is it a limitation or shortcut in pep8-naming that leads to this behavior?
Version: 0.14.1
The text was updated successfully, but these errors were encountered: