Minor nit. On May 22, 2012, at 04:43 PM, PJ Eby wrote: >def declare_namespace(package_name): > parent, dot, tail = package_name.rpartition('.') > attr = '__path__' > if dot: > declare_namespace(parent) > else: > parent, attr = 'sys', 'path' > with importlockcontext: > module = sys.modules.get(package_name) Best to use a marker object here instead of checking for None, since the latter is a valid value for an existing entry in sys.modules. > if module is None: > module = XXX new module here > module.__path__ = _NamespacePath(...stuff involving 'parent' and >'attr') Cheers, -Barry
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