Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
Benji, Thanks so much, you have saved the day ^_^ -- http://mail.python.org/mailman/listinfo/python-list

Re: a pickle's pickle

2005-08-02 Thread Benji York
[EMAIL PROTECTED] wrote: > So basically trainer always gets an existing TrainingMatrix(the class) > pickled object if there is a file to read from, otherwise it just makes > a new instance. Either way, the instance trainer is pickled at the end. Right, but the data you're interested in is contain

Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I intended to pickle the class instance I call trainer...from my code, also in the first post: trainerString = trainDB.read() trainer = loads(trainerString) except EOFError: trainer = TrainingMatrix() ... trainerString = dumps(trainer) ... So basically trainer always gets an

Re: a pickle's pickle

2005-08-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > class TrainingMatrix: > matrix = [] > estimator = {} > wordInfo = {} > contextInfo = {} > totalWordsProcessed = 0 > numWords = 0 > numContexts = 0 > matrixWords = 0 Is there some confusion between the scope of the class object and the sco

a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I'm trying to pickle a class, and while I get no errors or anything, almost none of the class instance gets pickled, and I don't know why...Here's the pickled output: (i__main__ TrainingMatrix p0 (dp1 S'matrixWords' p2 I4714 sS'numWords' p3 I4714 sS'totalWordsProcessed' p4 I46735 sS'numContexts' p