enhancement request: make py3 read/write py2 pickle format
Gregory Ewing
greg.ewing at canterbury.ac.nz
Wed Jun 10 19:30:23 EDT 2015
Robert Kern wrote:
> To allow people to write their own types that can be serialized,
> you have to let them specify arbitrary callables that will do the
> reconstruction. If you whitelist the possible reconstruction callables,
> you have greatly restricted the types that can participate in the
> serialization system.
If whitelisting a type is the *only* thing you need to
do to make it serialisable, I think that comes close
enough to the stated goal of being able to "serialise
all [potentially serialisable] language objects".
Having to be explicit about which types are deserialisable
is probably a good thing anyway. It gives you an opportunity
to specify the mapping between the external format and
class names, so that your serialised data doesn't contain
assumptions about implementation details of your program.
--
Greg
More information about the Python-list
mailing list