-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] Use globals in
generate_binary_build_matrix
Never seen `sys.modules[__name__].foo` trick before, but it seems to be exactly equivalent to the [global](https://docs.python.org/3/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python) keyword I.e. ```python import sys mod = sys.modules[__name__] def init_x() -> None: mod.x = 3 if __name__ == "__main__": init_x() print(x) ``` is equivalent to ```python def init_x() -> None: global x x = 3 if __name__ == "__main__": init_x() print(x) ```
- Loading branch information
Showing
1 changed file
with
49 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters