MemoryError in data conversion

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Apr 14 19:51:07 EDT 2014


Mok-Kong Shen wrote:
> I have yet a question out of curiosity: Why is my 2nd list structure,
> that apparently is too complex for handling by eval and json, seemingly
> not a problem for pickle?

Pickle is intended for arbitrary data structures, so it
is designed to be able to handle deeply-nested and/or
recursive data. Eval only has to handle nesting to depths
likely to be encountered in source code. Apparently the
json parser also assumes you're not going to be using
very deep nesting.

-- 
Greg



More information about the Python-list mailing list