[Python-Dev] advice needed: best approach to enabling "metamodules"?

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 29 22:24:25 CET 2014


Nathaniel Smith wrote:

> Option 4: Add a new function sys.swap_module_internals, which takes
> two module objects and swaps their __dict__ and other attributes. By
> making the operation a swap instead of an assignment, we avoid the
> lifecycle pitfalls from Option 3.

Didn't I see somewhere that module dicts are not being
cleared on shutdown any more? If so, then the lifetime
problem mentioned here no longer exists.

-- 
Greg


More information about the Python-Dev mailing list