[Python-Dev] python package

Gordon McMillan gmcm@hypernet.com
Sat, 13 Jul 2002 18:44:59 -0400


Marc-Andre,

In this thread you have posted:

> python.py:
> __path__ = ['.']

and

> def _redirect(mx_subpackage):
>     global __path__
>     import os,mx
>     __path__ = \
>  [os.path.join(mx.__path__[0],mx_subpackage)]

and

> testmodload.py:
> import sys, os
> sys.modules['testmodload'] = os

None of these will freeze successfully.

Two of them appear to rely on an implementation
detail - that __path__ (only defined for
imp.PKG_DIRECTORY's) will be followed even in
a plain module.

The third is exactly what _xmlplus does, and
consensus appears to be that that was a 
mistake.

"Clever" does not mean "good".

-- Gordon
http://www.mcmillan-inc.com/