[Mailman-Developers] Patch: Optionally Suppressing List Headers

Barry A. Warsaw barry@digicool.com
Thu, 5 Apr 2001 09:55:54 -0400


>>>>> "JRA" == Jay R Ashworth <jra@baylink.com> writes:

    JRA> Because then, at least old unchanged objects which were read
    JRA> in by the 'code inside the object' wouldn't break: they'd
    JRA> just have to pick up the default for that attribute.  When
    JRA> you wrote them *back out*, they'd automagically be fixed.

This happens now, since once that attribute's on the MailList object,
it'll get written back out to the .db file.

    >> Marshals, BTW, exist primarily to support caching of compiled
    >> byte code.  A .pyc file is a marshal with a little bit of
    >> header information.  They also happen to be an efficient way to
    >> store and load simple Python objects.  Pickles are better for
    >> more complex objects (e.g. instances, or cyclic data
    >> structures).

    JRA> Are pickles less prone to break the "objectization" of
    JRA> objects you're going to want persistent storage of?

I'm not sure I understand the question.  Marshal only handles built-in
types (ints, longs, dicts, lists, tuples) and wasn't designed to
handle instances.  That's what pickle is for (and see the cPickle
module for a really fast implementation of the pickle protocol).

-Barry