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
Code:
def __b(): [__a for __b in [__b] for _ in []] return locals()
On #104603, calling this gives:
>>> __b() {'__b': <function __b at 0x100e3e390>}
But on 3.11:
>>> __b() {}
So the locals() in the outer function can now include comprehension variables from the inner comprehension. cc @carljm
The text was updated successfully, but these errors were encountered:
pythongh-104619: never leak comprehension locals to outer locals()
58b7d96
gh-104619: never leak comprehension locals to outer locals() (#104637)
70c7796
carljm
Successfully merging a pull request may close this issue.
Code:
On #104603, calling this gives:
But on 3.11:
So the locals() in the outer function can now include comprehension variables from the inner comprehension. cc @carljm
Linked PRs
The text was updated successfully, but these errors were encountered: