| How it works and how it should be used are different. Say “no” to import side‐effects in Python: https://news.ycombinator.com/item?id=7536246 https://chrismorgan.info/blog/say-no-to-import-side-effects-... >I must be able to import your module— any module— at any time without anything breaking. Or even the beneficial side effect of some other module running 10% faster. ;) What side-effects, if any, are okay when importing a python module? https://softwareengineering.stackexchange.com/questions/4540... >Q: Is this a better design pattern or does it just kick the issue down the road? >A: Kicking the issue down the road is the basic idea of the "functional core, imperative shell" design pattern. Functional Core, Imperative Shell (2012): https://news.ycombinator.com/item?id=34860164 https://www.destroyallsoftware.com/screencasts/catalog/funct... |
Maybe Python 4 can make anything except a function definition or import be a syntax error in a module haha.