(Summary: good plan for name and place, issues exist w/sketched implementation) At 10:47 AM 12/16/02 -0500, Guido van Rossum wrote: >Time's running short (we're close to releasing Python 2.3 alpha 1); >we should decide on a name and a specific policy ASAP. I propose the >following: > > from pkgutil import extended_path > __path__ = extended_path(__path__, __name__) How would that work for say, 'zope.app'? >Where pkgutil.py could be something like this: > > import sys.path > > def extended_path(path, name): > """Extend a package's path. (XXX more.)""" > path = path[:] > for dir in sys.path: > if isinstance(dir, (str, unicode)): > dir = os.path.join(dir, name) > if dir not in path and os.path.isdir(dir): > path.append(dir) > return path > >--Guido van Rossum (home page: http://www.python.org/~guido/) The 'isdir()' part isn't going to work on zipfiles... unless os.path is going to have zipfile support in 2.3. :)
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