XML, JSON, or what?

Alan Kennedy alanmk at hotmail.com
Thu Jun 8 16:05:53 CEST 2006

>> I'd favour JSON if the data structures are simple personally. XML is
>> comparatively speaking a pain to deal with, where with JSON you can
>> simply eval() the data and you have a Python dictionary at your
>> disposal.

> Modulo any security problems that alert and malicious users are able to
> inject into your application. Simply using eval() uncritically on
> whatever comes down the pipe is a train wreck waiting to happen.

Yes, evaling JSON, or any other text coming from the web, is definitely
a bad idea.

But there's no need for eval: there are safe JSON codecs for python,


And one for javascript,


And most other languages you're likely to come across.



alan kennedy
email alan:              http://xhaus.com/contact/alan

More information about the Python-list mailing list