Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoscaling: Refactor code to top-level code environment
For making `autoscale.py` a real program, and good Python citizen, it is important to consider your file might be considered as a module, and _imported_. In this case, you don't want to have your main code executed. https://docs.python.org/3/library/__main__.html In this case, the program would have caused any sort of test runner, which scans directory trees for functions to executed, by, well, importing all modules, to eventually run into an eternal loop. When putting code into the top-level code environment, as exercised on behalf of the `__name__ == '__main__'` code guard, it will safely execute as a Python program, but not when used as a Python module. In this spirit, a Python file can be both a program and a module at the same time.
- Loading branch information