On Sat, Sep 9, 2017 at 1:27 AM, Joshua Morton <joshua.morto...@gmail.com> wrote:
> As a result of this, you can't even know if an import is safe, because that
> module may have side effects. That is, the module foo.py:
>
>     import bar
>
> isn't known to be lazy, because bar may import and start the logging module,
> as an example.

Laziness has to be complete - or, looking the other way, eager
importing is infectious. For foo to be lazy, bar also has to be lazy;
if you don't know for absolute certain that bar is lazy-loadable, then
you assume it isn't, and foo becomes eagerly loaded.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to