[Python-Dev] PEP for RFE 46738 (first draft)
Simon Wittber
simonwittber at gmail.com
Sat Jun 18 16:12:16 CEST 2005
> The RFE suggests that "the protocol is specified in the documentation,
> precisely enough to write interoperating implementations in other
> languages". If interoperability with other languages is really the
> issue, use an existing format like JSON.
JSON is slow (this is true of the python version, at least). Whether
it is slow because of the implementation, or because of its textual
nature, I do not know. The implementation I tested also failed to
encode {1:2}. I am not sure if this is a problem with JSON or the
implementation.
> If you want an efficient binary format you can use a subset of the
> pickle protocol supporting only basic types. I tried this once. I
> ripped out all the fancy parts from pickle.py and left only binary
> pickling (protocol version 2) of basic types. It took less than hour
> and I was left with something only marginally more complex than your
> new proposed protocol.
I think you are missing the point. Is your pickle hack available for
viewing? If it, or JSON is a better choice, then so be it. The point
of the PEP is not the protocol, but the need for a documented,
efficient, _safe_ serializion module in the standard library.
Do you disagree?
Simon Wittber.
More information about the Python-Dev
mailing list