[Python-Dev] when is binary mode required for pickle?

Gareth McCaughan gmccaughan@synaptics-uk.com
Thu, 13 Feb 2003 10:44:29 +0000


Guido wrote:

> For most people, yes.  "bin" is deprecated, "proto" should not be named
> (cPickle doesn't accept keyword arguments), and passing -1 is the best thing
> to do if you don't care about reading a pickle under an older version of
> Python than the one that wrote the pickle.  For compatibility reasons,
> though, the default proto value had to remain 0.

Suggestion: pickle.LATEST_PROTOCOL = cPickle.LATEST_PROTOCOL = -1 ?
(It could be spelled differently.) Or the string value "latest"
could be an acceptable value of proto. Or something. Anything rather
than magic numbers. :-)

-- 
g