no pickling code objects?

holger krekel pyth at devel.trillke.net
Fri May 24 09:04:16 EDT 2002


Johann H?chtl wrote:
[in response to the problem of pickling/unpickling code]
> You may take a look at
> 
> www.mozart-oz.org

thanks, the concepts on the site seem to be interesting. 
Their language looks a bit ugly, though :-)
 
> and their strategy / theory behind pickling and unpickling. In mozart 
> you are only allowed to pickle inmutable data. Otherwise you go crazy on 
> taking all considerations into account.

But i don't understand the reason for their statement 
(which you are refering to):

  "Anything stateless can be saved in a pickle, including functions, 
   procedures, classes, functors, records, and atoms. Stateful 
   entities, such as objects and variables, cannot be pickled."

Why is it giving headaches? Seems perfectly valid  to pickle/unpickle 
stateful objects. (in python classes, functions and so on *are* 
stateful objects). Of course you might run into concurrency problems.
but i mean: pickling immutable object seems almost redundant :-)

My original problem was:

> > But the basic problem with pickling/unpickling code objects
> > is to transport the transitive closure of code objects: you need to
> > have the code objects which your pickled code objects
> > depends on. And next the code objects which these code
> > objects depend on ...
> > 
> > At the same time you don't want to pickle code of
> > the python standard distribution usually (at least
> > not sys/os and friends).  

I don't know if the mozart people have solved this problem.
it has a lot to do with versioning/managing code and modules.

regards,

  holger





More information about the Python-list mailing list