[Python-Dev] backwards and forwards compatibility, the exact contents of pickle files, and IntEnum
Serhiy Storchaka
storchaka at gmail.com
Sun Mar 15 08:13:55 CET 2015
On 15.03.15 07:52, Ethan Furman wrote:
> So how do we fix it? There are a couple different options:
>
> - modify IntEnum pickle methods to return the name only
>
> - modify IntEnum pickle methods to pickle just like the int they represent
>
> The first option has the advantage that in 3.4 and above, you'll get back the IntEnum version.
>
> The second option has the advantage that the actual pickle contents are the same [1] as in previous versions.
>
> So, the final question: Do the contents of a pickle file at a certain protocol have to be the some between versions, or
> is it enough if unpickling them returns the correct object?
With the second option you lost the type even for 3.5+. This is a step back.
More information about the Python-Dev
mailing list