[mod_python] Module importer issues list updated.

Martin MOKREJŠ mmokrejs at ribosome.natur.cuni.cz
Fri Feb 3 17:03:28 EST 2006



Graham Dumpleton wrote:
> 
> On 03/02/2006, at 10:07 PM, Martin MOKREJŠ wrote:
> 
>> After reading "Auto Reload Mechanism" section and especially
>> <quote>
>> If the importing of the module by an explicit call to the
>> "import_module()"
>> function is performed at global scope within a module, whether the child
>> module has changed and whether it needs to be reimported, is only
>> determined at the time that the parent module is first imported and
>> when the parent module is subsequently reimported.
>> </quote>
>>
>> I am not certain what happens when using normal python import()
>> function and I for example changed only some of those child modules.
>> Will they be reloaded? It is probbly answered by the first paragraph in
>> the section cited above, but am not certain.
> 
> 
> The way things work at the moment is that if you import a module using
> just the "import" statement, it will never be reloaded. This is even if
> the parent module that it was imported in was reloaded. This is standard
> for Python.

Please, put this into the document as well. I had the impression I should
revert from the "apache.import_module()" to the builtin "import" function.
Good to hear that will never work. ;-) So now I know the only fix for me is
always to touch(1) all the parent modules if a child has been modified.
Fortunately, it is only one file extra in my case.

> 
>> I think it would be nice if you'd include what is usually the IO penalty
>> for all those stat() calls to determine whether a module has changed
>> or not.
> 
> 
> I am going to quote something from documentation I am writing on how the
> replacement module loader will work:
> 
>   First and foremost any replacement system should strive for correctness
>   and robustness. Inevitably this may mean some reduction in performance.
>   Tuning of the system to improve the performance should be seen as a
>   secondary task, only carried out after the functionality of the system
>   is found to be correct and adequate to replace the existing system.
> 
> I have this big note in the documentation because part of the reason that
> I gave up discussing a new system on the mailing list in the past is
> because some wanted to focus more on their concerns about performance
> over whether the system worked correctly.
> 
> Can we please not go down that avenue at the moment and focus on getting
> something that works first. :-)

Oh sure, I have no problem with that. ;)

martin


More information about the Mod_python mailing list