[Python-ideas] Python Object Notation (PyON)

Zaur Shibzoukhov szport at gmail.com
Mon Nov 3 06:52:19 CET 2008


Arnaud Delobelle wrote:
> Looking at the page, it seems to me that it aims to:
> * be able to give a string representation of any(*) object like pickle
> and unlike json
>* produce human readable output like json and unlike pickle
Yes it works that way.

> (*) for a suitable definition of 'any', ideally the same as pickle I
> guess.
Now pyon can't dump any recursive object. It can dump recursive lists
and tuples now.
I also going to add support for recursive dicts, and then for other objects.

> lst = [1, 2]
> obj = [lst, lst]
pyon.dumps(obj, fast=False; this mode similar to pickle's fast mode)
produce a following text:
_p__0=[1,2]
[_p__0,_p__0]

pyon.dumps(obj) (i.e. fast=False) produce a following text:
[[1,2],[1,2]]

Best regards,
Zaur



More information about the Python-ideas mailing list