In this thread you have posted:
python.py: __path__ = ['.']
def _redirect(mx_subpackage): global __path__ import os,mx __path__ = \ [os.path.join(mx.__path__,mx_subpackage)]
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/