M.-A. Lemburg wrote: > Why not leave sys.path as list of ordinary strings and add > all the extra support to the existing import mechanism via > hooks at the right places ?! > > E.g. such a hook may scan sys.path for files which end > in '.zip' and then redirect the lookups into their ZIP > archive directory. Then you get the problem that Samuele pointed out: if the *hook* scans sys.path you get a funny path resolution order: hooks[0] may find the module on sys.path[3] before hooks[2] finds it on sys.path[2]. We should document that - sys.path *may* contain arbitrary objects, and that sys.path traversing code should be careful. - the std library promises to not add objects to sys.path that are not isinstance(p, (str, unicode)). I think this is the perfect compromise. Thank you </F>! 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