Jack Jansen wrote: > > Regarding sys.import_hooks, I see three possibilities: > > > > #1 > > for p in sys.path: > > for hook in sys.import_hooks: > > hook(p, ...) > > > > #2 > > for hook in sys.import_hooks: > > for p in sys.path: > > hook(p, ...) > > > > #3 > > for hook in sys.import_hooks: > > # the hook can traversing sys.path if needed. > > hook(...) what's wrong with: #4 for path in sys.path: if isinstance(path, types.StringTypes): do_standard_import(...) else: path.do_import(...) after all, everyone knows how the path works, and everyone knows how to manipulate sys.path inside a Python program. (for PIL and other plug-in architectures, a "path.get_list_of_modules" method would also be nice). </F>
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