[Python-Dev] Pre-PEP: Redesigning extension modules

Terry Reedy tjreedy at udel.edu
Sun Aug 25 20:06:49 CEST 2013


On 8/25/2013 7:54 AM, Stefan Behnel wrote:

> And what if you do "from extmodule import some_function" in a Python
> module? Then reloading couldn't replace that reference, just as for normal
> Python modules. Meaning that you'd still have to keep both modules properly
> alive in order to prevent crashes due to lost global state of the imported
> function.

People who want to reload modules sometimes know before they start that 
they will want to. If so, they can just 'import' instead of 'from 
import' and access everything through the module. There is still the 
problem of persistent class instances directly accessing classes for 
attributes, but maybe that can be directed through the class also.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list