no pickling code objects?

Michael Hudson mwh at python.net
Thu May 9 06:44:55 EDT 2002


holger krekel <pyth at devel.trillke.net> writes:

> just a comment: i need pickling of code objects. Anyone implementing
> mobile network agents might be interested, also. Up until now
> i just grab the source/byte code and send it over as a string.

You can *marhsal* code objects easily enough (hey, that's what marshal
was invented for!).

But that obviously doesn't solve all the problems:

> 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 ...

Well, indeed.

This might be another motivation for not pickling functions; the
decisions get really hairy and basically impossible to guess
accurately, so Python punts.

[...]
> Has anyone figured these issues out already?

pyro?

But there's a fair chance that your exact problem hasn't been solved
before and you'll have to work out your exact requirements.  Then you
can start looking to see if any existing frameworks can get you
off the ground quicker...

Cheers,
M.

-- 
7. It is easier to write an incorrect program than understand a
   correct one.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list