1What follows from this
- A module's body runs exactly once per process, and the result is cached
- Everything at the top level is process-wide global state that leaks between tests
from x import y creates a separate binding → patch where it is used- The module object goes into the cache before the body executes → “partially initialized”
- Anything can happen on import, including seconds of work at startup
- Executing a module means nine phases of compilation, and the result is cached in
.pyc
2Chapters of this root