cPickle problems

Paul McGuire ptmcg at austin.rr._bogus_.com
Sun Nov 19 07:45:28 CET 2006

"Jeff Poole" <korvus at gmail.com> wrote in message 
news:1163730111.641857.142850 at k70g2000cwa.googlegroups.com...
> So when something tries to retrieve .__getstate__, it returns an empty
> string.  If I tell it to raise an AttributeException instead, then I
> get this message:
> TypeError: a class that defines __slots__ without defining __getstate__
> cannot be pickled
> I think I need to talk to the author of PyParsing about this one...
> Thanks for your help!
> Jeff

Jeff -

Sorry not to reply sooner, I have been out of town with limited access to 
c.l.py.  Also, I didn't really pick up on "cPickle problems" as a 
pyparsing-related post. :)

I would be happy to make ParseResults picklable, I didn't realize that this 
getattr behavior was defeating that capability.  I have had people 
successfully use pickle on pyparsing grammars, but have not had anyone 
report any pickle experience with ParseResults objects, either pro or con.

I have a test version of pyparsing with pickling support added, and it 
passes my simple unit tests.  I could send it to you if you would test it 
against your program.

-- Paul

More information about the Python-list mailing list