Neat trick, thanks for posting it.
···
-----Original Message-----
From: John Meinel [mailto:john@johnmeinel.com]Just to butt in a little bit and add a tidbit of info. I've worked a
little on trying to make dependencies less strict in python.
(Specifically I write for python2.3, but want it to run in py2.2).One really neat trick that I found is:
sys.modules['modulename'] = Module
So if you can guarantee that your module is loaded first, you
can do the following:try:
import Numeric
except ImportError:
import sys, NumericLite
sys.modules['Numeric'] = NumericLiteThen anyone who tries to 'import Numeric' will get your
package, rather than failing.