From: "Just van Rossum" <just@letterror.com> > Gordon McMillan wrote: > > > Here's what iu.py does: > > > > The first time an entry on sys.path requires > > examination, the list of importers is traversed > > until one accepts it. That importer is associated > > with the name, so subsequent imports are only > > one dict lookup away from the importer. > > > > Search order is as expected (sys.path.insert(0, ...) > > works). If your app only uses stuff from sys.path[0], > > no time is wasted finding the right importers for > > sys.path[1:]. > > Ok, that's is a much clearer picture than I ever got from reading the code, > thanks. (And sorry Paul, you've been saying this all along; it's been an > entertaining and very educating trip for me ;-) > > At the cost of some complexity this indeed solves all our problems: > - importers can be associated with sys.path elements matching a pattern > - adds a high level import hook mechanism > - makes plugging in a zipimporter a snap > - doesn't muck with sys.path > > I'll have a whack at integrating this in import.c. what about __path__'s role in this picture (btw this is not a rhetoric question)? regards.
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