15 Mar
2015
15 Mar
'15
7:13 a.m.
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.