Re: [Python-Dev] backwards and forwards compatibility, the exact contents of pickle files, and IntEnum

Bringing back on list. :) On 03/15/2015 12:18 AM, Glenn Linderman wrote:
Exactly. IntEnum was advertised as being a "drop-in replacement" with the only change being better reprs and strs; so being unable to un-pickle in prior versions invalidates that claim. Part 2 of my question (Part 1 of which is "which method do we use to fix the IntEnum being used in the stdlib") is: do we just change the IntEnum subclasses (such as socket.AddressFamily) to have the fixed behavior, or do we change IntEnum itself? Having thought about it for a few minutes, we cannot make that change in IntEnum itself as it only works if the names are exported to the global namespace -- so this fix will work for the stdlib (since we export the names), but won't work otherwise. Unless someone steps forward and says that the actual pickle contents must be the same, I'm going to go with pickling the name: this is both unpicklable in prior versions, and doesn't lose the type in present versions. Just to be clear, there are no issue unpickling in the same version, only in prior versions. -- ~Ethan~
participants (1)
-
Ethan Furman