3 ms·
I don't see how these two are the same. No side effects at import time? Sure. But a program isn't meant to be imported, it's meant to be run, so there's no real
by tdeck 6y ago
I don't see how these two are the same. No side effects at import time? Sure. But a program isn't meant to be imported, it's meant to be run, so there's no real expectation that a program should be importable without side effects.
- shoo 6y agothey're not the same, but they're both symptoms of the same underlying python behaviour: when you run a python file or import a python file, the interpreter immediately starts executing statements from the top of the file down.