[erlang-questions] Python pickle protocol 0 to erlang

Tim McNamara <>
Tue Jul 31 23:30:53 CEST 2012


Yes/No.

Pickle is an object serialisation format. Translating arbitrary
objects wont work. You can easily pickle Python functions, which are
represented as references to the __main__ namespace.

>>> import pickle
>>> def sumr(*args):
...     try:
...         return args[0] + summa(*args[1:])
...     except IndexError:
...         return 0
>>> print pickle.dumps(sumr, 0)
c__main__
summa
p0
.

If you are transferring data, there are probably better alternatievs.
People have promoted JSON in this thread. My personal preference lies
with YAML when human readability counts, or Google Protocol Buffers
for guarantees, speed & reliability.


On 1 August 2012 08:33, Radu Brumariu <> wrote:
> Hi,
> is there a module that converts a python pickle into erlang term(s) ?
>
> Thanks,
> Radu
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list