[Python-Dev] adding save() and load() function for interactive use

Phillip J. Eby pje at telecommunity.com
Mon Dec 1 14:06:57 EST 2003

At 07:30 PM 12/1/03 +0100, Gerrit Holl wrote:
>save() is easily implemented by pickling
>  locals(); load() is easily implemented by updating
>  locals() while unpickling it.

Functions and classes are pickled as references to a module, so this 
wouldn't actually work.  When you try to load(), the unpickling will fail 
if the function or class doesn't already exist in the module.

More information about the Python-Dev mailing list