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/2002-December/030942.html below:

[Python-Dev] New and Improved Import Hooks

[Python-Dev] New and Improved Import Hooks [Python-Dev] New and Improved Import HooksJust van Rossum just@letterror.com
Sat, 7 Dec 2002 00:55:13 +0100
Guido van Rossum wrote:

> The problem with trying to load x.y right away is that then you can't
> distinguish between "x.y doesn't exist" (and then you go to step 2)
> as opposed to "x.y exists, but it tries to import something else that
> raised ImportError" (and then you should simply propagate the
> exception).

Also not true: a function that finds *and* loads a module can return None for
"module not found", a new module object upon succes, and propagate an error if
one did occur during import. I'm tempted to make my new import hook scheme work
that way: it avoids a few hoops I have to go through with import.c, as right now
I'm quite limited what zipimporter.find_module() can communicate to
zipimporter.load_module(). (It would also make it even closer to iu.py ;-)

Just



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