A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-February/116338.html below:

[Python-Dev] requirements for moving __import__ over to importlib?

[Python-Dev] requirements for moving __import__ over to importlib? [Python-Dev] requirements for moving __import__ over to importlib?Nick Coghlan ncoghlan at gmail.com
Thu Feb 9 02:43:02 CET 2012
On Thu, Feb 9, 2012 at 11:28 AM, PJ Eby <pje at 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   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4