We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
def f(x): def g(): print([x for x in range(10)]) def h(): print(x) return h print(x) return g f(1)()()
The above had always bound x in h to the parameter of f. But it no longer works and somehow binds to a local in g, throwing the following error:
x
h
f
g
NameError: cannot access free variable 'x' where it is not associated with a value in enclosing scope
3.12
Linux, Windows
The text was updated successfully, but these errors were encountered:
This is probably related to PEP 709 @carljm .
Sorry, something went wrong.
I've just moved house and am behind on everything, so it may be a bit before I can get to this, but I will fix it.
@carljm any updates?
I'm intending to work on this during the upcoming core dev sprint in September. If someone else gets to it first that's fine, though!
pythongh-121377: Fix closure with intervening comprehension
fd41682
7b17af2
carljm
No branches or pull requests
Bug report
Bug description:
The above had always bound
x
inh
to the parameter off
. But it no longer works and somehow binds to a local ing
, throwing the following error:CPython versions tested on:
3.12
Operating systems tested on:
Linux, Windows
Linked PRs
The text was updated successfully, but these errors were encountered: