We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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 test_var_annot_refleak(self): # complex case: custom locals plus custom __annotations__ # this was causing refleak cns = CNS() nonloc_ns = {'__annotations__': cns} class CNS2: def __init__(self): self._dct = {'__annotations__': cns} def __setitem__(self, item, value): nonlocal nonloc_ns self._dct[item] = value nonloc_ns[item] = value def __getitem__(self, item): return self._dct[item] exec('X: str', {}, CNS2()) self.assertEqual(nonloc_ns['__annotations__']['x'], str)
expected result: silent exit without error
actual result:
SyntaxError: no binding for nonlocal 'nonloc_ns' found at line 0 column 0
The text was updated successfully, but these errors were encountered:
fixed by #1951
Sorry, something went wrong.
No branches or pull requests
Feature
code
expected result: silent exit without error
actual result:
Python Documentation
The text was updated successfully, but these errors were encountered: