[mod_python] PSP imports

Dan W. dwmp at opti.cgi.net
Tue Nov 25 00:36:03 EST 2003

At 09:53 PM 11/24/2003 -0800, you wrote:
>Dan W. wrote:
>>Ahhh, Ok.  I guess that means I can't use the form:
>>from mypackage.mymodule import *
>It's a good idea to avoid that type of namespace pollution anyway, as it 
>can often lead to conflicts.  It also detracts from code readability 
>(avoiding the dreaded "where did that name come from again?" question when 
>doing code reviews is a good thing, IMHO).

That's a good point Michael.  That was probably a bad habit to pick 
up.  However, I think a overloaded import could still be 
useful.  Overloading the builtin import would allow a PSP file to control 
autoreloading for its entire dependency tree (modules which call other 
modules, etc.).  This would allow one to easily turn autoreloading on 
during development and to easily turn it off for production deployment.

I'm still cutting my teeth on the mod_python code base, but figured I'd 
throw that idea out there in the mean time.


More information about the Mod_python mailing list