Barry Warsaw <ba...@python.org> wrote:
> There are a few other things that might end up marking a module as
> "industrious" (my thesaurus's antonym for "lazy").

Good points.  The analysis can be simple at first and then we can
enhance it to be smarter about what is okay and still lazy load.  We
may evolve it over time too, making things that are not strictly
safe still not trigger the "industrious" load lazy anyhow.

Another idea is to introduce __lazy__ or some such in the global
namespace of the module, if present, e.g.

__lazy__ = True

then the analysis doesn't do anything except return True.  The
module has explicitly stated that side-effects in the top-level code
are okay to be done in a lazy fashion.

Perhaps with a little bit of smarts in the analsis and a little
sprinkling of __lazy__ flags, we can get a big chunk of modules to
lazy load.

_______________________________________________
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