[Python-Dev] Pickler/Unpickler API clarification
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Mar 5 22:36:35 CET 2009
Guido van Rossum wrote:
> This was a bad idea (*), and I'd be happy to ban it -- but we'd
> probably have to bump the pickle protocol version in order to maintain
> backwards compatibility.
If you're talking about multiple calls to dump() on the same
pickler, it might be a bad idea for a network connection, but
I don't see anything wrong with using it on a file, and I find
it useful to do so sometimes. Banning it would be excessive, IMO.
> The exposition is unintentional but for historic reasons we can't just
> remove it. :-(
A compromise might be to provide a memo attribute that returns
a wrapper around the underlying cache -- maybe with only a
clear() method if that's all you want to support.
--
Greg
More information about the Python-Dev
mailing list