For a quick and easy way to save interpreter state across sessions in Python, wouldn't it be nice if module attributes set within the session persisted? With the permod.py module, they do:
>>> import permod, time >>> permod.now = time.time() >>> reload(permod) <module 'permod' (built-in)> >>> permod.now 1114680641.1300001
It works by storing attributes written to it in a shelve database, which by default is housed at permod.data in the same directory as the module itself—though you can easily change that behaviour. Since it uses shelve, you can store anything that the pickle module can handle.
Something I noticed when writing permod.py was that of all the nice new-style types that Python has in its builtins list, it's missing one strange exception: the module type. You still have to use types.ModuleType at the moment, which seems odd when the types module could otherwise probably be deprecated.