[Python-Dev] Iterating over marshal/pickle
mal at egenix.com
Mon Oct 9 21:48:04 CEST 2006
Fredrik Lundh wrote:
> Tim Lesher wrote:
>> 1. Does this seem like a reasonable addition to the standard library?
> I cannot remember ever doing this, or seeing anyone except Perforce
> doing this, and it'll only save you a few lines of code every other year
> or so, so my answer is definitely no.
> (if you're serious about P4 integration, you probably don't want to use
> Python's marshal.load to deal with the P4 output either; the marshalling
> code has had a tendency to crash Python when it sees malformed or pre-
> maturely terminated output).
>> Incidentally, I know that pickle is preferred over marshal, but some
>> third-party tools (like the Perforce client) still use the marshal
>> library for serialization, so I've included it in the discussion
> Perforce is the only 3rd party component I'm aware of that uses a
> standard Python serialization format in this way.
> As the x windows people have observed, the only thing worse than
> generalizing from one example is generalizing from no examples at
FWIW, we've been and are using this quite a lot for dumping
database content to a backup file. It's a simple and terse format,
preserves full data precision and doesn't cause problems when
moving between platforms.
That makes two use cases and I'm sure there are more ;-)
Professional Python Services directly from the Source (#1, Oct 09 2006)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
More information about the Python-Dev