[Python-3000] pickle compatibility between 2.x and 3.0
Fred Drake
fdrake at acm.org
Fri Nov 2 05:54:29 CET 2007
On Nov 2, 2007, at 12:37 AM, Gregory P. Smith wrote:
> Or is that too much work and not enough context in the callable to
> be useful? People could just as easily write code to recurse
> through the unpickled output converting the appropriate bytes
> objects as needed.
Not enough context to be useful, but it might be the best that can be
done. Calling a function and passing a bytes value allows the
application to know that Python 2 str was encountered, and gives the
application the opportunity to deal with it when the unpickling is
done, or raise an exception.
I'd be happy if the "default" behavior on str values is to raise an
exception, rather than ever making a guess silently.
-Fred
--
Fred Drake <fdrake at acm.org>
More information about the Python-3000
mailing list