Package name with '.' in them: Python Bug ?

Yannick Patois patois at calvix.org
Sat Mar 20 10:42:42 EST 2004


Josiah Carlson wrote:
> You didn't answer my question as to whether module_5.py is reasonable 
> replacement for the module.5.py naming scheme you are currently using.

That's what I'm doing now, of course, even if it cause some problems I 
have to solve another way.


>> The doc is not so explicit. It says that hierarchical modules are not 
>> handled by load_module(), fine, i dont want to handle hierarchicals 
>> one, just a simple one that has a don in its name. 
> 
> The documentation is specific, you quoted it yourself:
> "This function does not handle hierarchical module names (names 
> containing dots)."
> 
> Any file name with a dot that is not the extension of the file, is 
> considered hierarchical

This point wasnt clear to me when I read the doc. I well understood 
"hierarchical files uses dots" but not "any dots means hierarchy", and 
in fact it does work that way, as the import of "B.1" didnt imported 
submodule 1 from B but really "B.1".

> and is "not handled".

Well, in fact it is, it only cause very subtle bugs afterwards.

>>> then the error is in the way /you/ name /your/ modules, not the way 
>>> Python handles /incorrectly/ named modules.
>> That's exactly what I said, and I tend to believe it.
> Then you agree that your naming scheme is flawed.  Stop doing it.

I stopped using it as soon as I understood that the problem was there.
I think that such a thing should not work at all and not "partially 
work", but I'm not a python master, and maybe it doesnt worth to be 
done. I'm just rising the issue here.

	Yannick

-- 
_/ Yannick Patois \___________________________________________________
| web: http://feelingsurfer.net/garp/ | Garp sur irc undernet          |
| email:  patois at calvix.org           |                                |
| ATTAC dans le Pays de Gex: http://attacgex.ouvaton.org               |



More information about the Python-list mailing list