Text File
module.txt

Persistent Modules

Document Overview

This document seeks to capture technical information about persistent modules to guide and document their design.

Goals

These goals largely come from Zope 3. It would be worth while considering other applications.

Use cases

Edge cases

???

Fundamental dilema

Python modules were not designed to change at run time. The source of a Python module normally doesn't change while a Python program is running. There is a crude reload tool that allows modules to be manually reloaded to handle source changes.

Python modules contain mutable state. A module has a dictionary that may be mutated by application code. It may contain mutable data that is modified at run time. This is typeically used to implement global registries.

When a module is reloaded, it is reexecuted with a dictionary that includes the results of the previous execution.

Programs using the ZODB may be said to have logical lifetimes that exceed the lifetimes of individual processes. In addition, the program might exist as multiple individual processes with overlapping run-times.

The lifetime of a persistent program is long enough that it is likely that module source code will change during the life time of the program.

Issues

Special cases

This section contains examples that may introduce challenges for persistent modules or that might motivate or highlight issues described above,

Proposals

Notes