Skip to content

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests don't need their own news entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I've removed the Tests NEWS entry file.

@bombs-kim bombs-kim changed the title gh-58749: Add test_nonlocal.py to ensure correct behavior of nonlocal statements and add NEWS entries gh-58749: Add test_nonlocal.py to ensure correct behavior of nonlocal statements Dec 23, 2025
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.

2 participants