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/030817.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
Thu, 5 Dec 2002 16:12:01 +0100
Samuele Pedroni wrote:

> what about __path__'s role in this picture (btw this is not a rhetoric
> question)?

pkg.__path__ is just another sys.path. Whatever rules we make up for sys.path,
they are identical for pkg.__path__. When traversing path, find_module() doesn't
even know whether it's dealing with sys.path or a package's __path__.

The way I see it, the dict that maps path items to handlers also maps __path__
items; all handlers will live there, and there's just one such dict. I think
that a zipimporter would put something like this in __path__

  ["/path/to/archive.zip!packagename"]

So the zip handler will have to do a little more than just checking for a *.zip
extension. I assume you do something like it in Jython, too? (I picked up the
'!' from you I think; it makes it easier/quicker to check for zipness.)

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