Gustavo Niemeyer <niemeyer@conectiva.com> writes: > Yes, it is addressed. My propose is to allow the importer mechanism to > check if there's something importable with the given name in the given > path, instead of telling him what to import. With that in mind, > importing foobar.py.bz2 is just a matter of checking for > <modulename>.py.bz2 in the given path. It appears that this can't be really done with the proposed mechanism, as you want to have a multiple hooks for a single source "URL". If you *only* want to have a .py.bz2 importer, you could replace every directory on sys.path with the pybz2importer, which would check for .py.bz2 files in the directory, and, if that fails, calls imp.find_module. Of course, if somebody wants to provide a crypt importer (which decrypts the source before importing it) in addition to the pybz2importer, then you get the same coordination problem as with all prior import hooks. So you are back to calling all registered hooks for all items on sys.path, which might be expensive. 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