I agree that focusing on pickling might be a sensible way to go about it. Specifically, make it so that the instance returned by lex() and yacc() can be pickled as desired by the user.
I'm not planning any changes along these lines for Ply-3.5, but will consider it in future releases later.
On Apr 27, 2012, at 4:49 AM, David Cournapeau wrote:
> I use ply to parse the package declaration in my packaging tool bento, and the related command line tools would be significantly slower without the ply caching.
> OTOH, the current caching solution is a bit difficult to use in those situation: I think having a pickable object, and extracting the caching policy away from the main code would cover most usecases in that context.