[Spambayes] Guidance re pickles versus DB for Outlook

Neale Pickett neale@woozle.org
Tue Nov 26 21:13:19 2002


So then, Tim Stone - Four Stones Expressions <tim@fourstonesExpressions.com> is all like:

> Do we really need this state object at this point?  I can't see any 
> benefit to having this object at this point...

Well, we do get some use out of it.  Or we would if we used it the way I
thought we were :)

I had intended for this class to get pickled and stored like so in
DBDictClassifier.store():

  self.wordinfo[self.statekey] = self.meta

If we do this, then we get something that will break when the
PICKLE_VERSION changes.  Also, as has been pointed out by someone else,
it's a handy place to store things, without DBDictClassifier having to
know what's inside itself.

OTOH, since it's a subclass of classifier.Classifier, it'd be just as
easy to write getstate() and setstate() methods on Classifier to return
what would be in self.meta.  They don't have to be named that, of
course.

I don't know which one is uglier.  But right now the DBDict is storing
"meta" information differently than everything else, so something's
gotta give.  Anyone have an opinion on which is better?

Neale



More information about the Spambayes mailing list