Skip to content

gh-58749: Add test_nonlocal.py to ensure correct behavior of nonlocal statements and add NEWS entries #126738

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bombs-kim
Copy link
Contributor

@bombs-kim bombs-kim commented Nov 12, 2024

As suggested by @ncoghlan:

  • Added test_nonlocal.py
  • Added a Documentation NEWS entry
  • Added a Tests NEWS entry

In tests, I've decided to use simply the variable names, rather than using f.__closure__[0].cell_contents. It seems to me that both approaches can ensure the correct behavior of nonlocal statements and simply using the variable names would make the test code easier to understand. I will change it back to f.__closure__[0].cell_contents if this is not desirable.

@bombs-kim
Copy link
Contributor Author

@ncoghlan Could you give this PR a review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant