ruff
5f2e855c - allow reads of "free" variables to refer to a `global` declaration

Commit
148 days ago
allow reads of "free" variables to refer to a `global` declaration Previously this worked if there was also a binding in the same scope as the `global` declaration (probably almost always the case), but CPython doesn't require this. This change surfaced an error in an existing test, where a global variable was only ever declared and bound using the `global` keyword, and never mentioned explicitly in the global scope. @AlexWaygood suggested we probably want to keep that requirement, so I'm adding an a new test for that on top of fixing the failing test.
Author
Committer
Parents
Loading