David Bear
David.Bear at asu.edu
Thu Aug 3 18:55:40 EDT 2006
On Thu, Aug 03, 2006 at 06:24:03PM -0400, Graham Dumpleton wrote: > 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? I was attempting to do something that wasn't documented. I was hoping to be able to import somelongmodulename_version_1_2_3 as s from s import * but that doesn't work;-) > > Graham -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing"
|