April 26, 2012
12:04 a.m.
On Tue, Apr 24, 2012 at 8:55 PM, Steven D'Aprano <steve@pearwood.info> wrote:
- encourages or requires duplicate code and copy-and-paste programming
How does stopping a module definition early encourage duplicate code? Just because you might have to react differently after a full import vs a partial?
Today, if you successfully import a module, you know that all the top-level code in that module was executed.
No, you don't. On the other hand, the counterexamples (circular imports, some lazy imports, module-name clashes, top-level definitions dependent on what was already imported by other modules, etc) are already painful to debug. -jJ