On Thu, Feb 9, 2012 at 11:28 AM, PJ Eby <p...@telecommunity.com> wrote: > The main two reasons you wouldn't want imports to *always* be lazy are: > > 1. Changing sys.path or other parameters between the import statement and > the actual import > 2. ImportErrors are likewise deferred until point-of-use, so conditional > importing with try/except would break.
3. Module level code may have non-local side effects (e.g. installing codecs, pickle handlers, atexit handlers) A white-listing based approach to lazy imports would let you manage all those issues without having to change all the code that actually *does* the imports. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com