logilab-common #122443 Support __path__ in modutils [validation pending]
As per the following docs:
http://docs.python.org/2/tutorial/modules.html#packages-in-multiple-directories
python packages (__init__.py files) can update their __path__ variable to contain a list of different directories. This allows developers to have different parts of their package live in different directories.
The function _module_file() in modutils.py, when handling package files, assumes that the "path = [mp_filename]" (line 636). This could support the __path__ mechanism by loading the module and then setting "path = module.__path__".
The following patch has been tested and works as intended.
608a609 | |
priority | normal |
---|---|
type | enhancement |
done in | 1.0.0 |
load | 1.000 |
load left | 0.000 |
closed by | #5e15c1218a55 [modutils] Add basic support for namespace packages |
patch | [modutils] Add basic support for namespace packages [applied] |
Comments
-
2013/04/11 12:17, written by sthenault
-
2015/06/25 17:35, written by rcardona
add commentthough the whole point of this function is to not actually import modules, so such patch can't be accepted.
there is some more support for namespace packages in upcoming changes, though it probably still doesn't catch all cases (e.g. nested namespaces)