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/030850.html below:

[Python-Dev] New and Improved Import Hooks

[Python-Dev] New and Improved Import HooksMartin v. Löwis martin@v.loewis.de
06 Dec 2002 00:17:44 +0100
"Wiktor Sadowski" <art@wiktorsadowski.com> writes:

> >I still don't understand. Is that some feature of Python?
> 
> Under Windows you can put a Module.pyd into Python/DLLs directory and:
> import Module

I see. Notice that there is nothing special about the DLLs
directory. Instead, you can have .pyd files anywhere on sys.path, and
the DLLs directory is included in sys.path - that's why .pyd files are
found in the DLLs directory.

> >If I have "python23.zip", and do
> 
> >import httplib
[...]
> >So you could only zip entire packages? 
> No.

All your explanations indicate otherwise.

> "from MyArchive import MyModule"
> would be resolved by zip importer as:
> if there is MyModule in MyArchive.zip then then import MyModule
> (means extract and import)
> 
> and
> import Module:
> if Module.zip contains Module import Module

So if I do

import httplib

it will check httplib.zip. Correct? That won't help, since httplib is
in python23.zip, not in httplib.zip.

According to your proposal, I would have to write

from python23 import httplib

But I don't want to, since httplib is a toplevel module, which is not
included in a python23 package.

Regards,
Martin




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