[mod_python] import failure

Graham Dumpleton grahamd at dscpl.com.au
Thu Aug 3 18:24:03 EDT 2006


Jim Gallacher wrote ..
> David Bear wrote:
> > does modpython support the syntax
> > 
> > import somemodulename as s
> > 
> > and then using 
> > 
> > s.somefunc()
> 
> yes

Of course, the reason being that if your version of Python that you are using
supports it, then it will also be supported. Use an old enough version which
does not support it, then it will not work. Presuming that is that those old
versions of Python even work with mod_python.

Anyway, the point of this email is to say that the above even works when the
new module importer in mod_python 3.3 is used. What this means is that if
'somemodulename' module was able to be imported as a reloadable module,
modifying that module will still automatically cause a parent module it is
imported in to be automatically reloaded even though the parent may not have
changed. This is despite that the module name has been aliases to something
else with the parent.

Are you having a specific problem which would make you ask this, as it would
have been quite easy to write a test to see if it does or doesn't work?

Graham


More information about the Mod_python mailing list