[Python-ideas] Python Object Notation (PyON)

Zaur Shibzoukhov szport at gmail.com
Fri Nov 7 06:27:09 CET 2008

I am sure that it is now too early to draw conclusions about PyON.

Best regards,

2008/11/7 Josiah Carlson <josiah.carlson at gmail.com>:
> On Thu, Nov 6, 2008 at 12:08 AM, Zaur Shibzoukhov <szport at gmail.com> wrote:
>> 2008/11/6 Josiah Carlson <josiah.carlson at gmail.com>:
>>> I guess I really don't understand the purpose of PyON.  Syntactically
>>> it doesn't fit between json and yaml.  It supports features that are
>>> more useful for a serialization language for RPC, etc., rather than
>>> configuration/inlining.  And it doesn't really offer a reverse of
>>> representation -> object without going through the standard Python
>>> parser and executing the result (which has security implications).
>> PyON dosn't use exec in order to reconstruct obbject.
>> It uses python parser for constructing AST and then builds object
>> using pickle-like protocol from AST.
>> I guess PyON could be used as standard reconstructable representation
>> of python objects.
> Then that strictly limits it to Python.  No other language can make
> use of it.  And in that sense, we may as well use pickle (which is
> fast, already exists, supports recursive object definitions, as well
> as arbitrary Python objects).
>>> Again, json is very human readable/writable, is very close to literal
>>> Python syntax, and already has support in just about every language
>>> worth discussing (and Python offers a json loading module in the
>>> standard library).  Can you give me a good reason why someone would
>>> want to choose PyON over json in 6 months?
>> If someone need standard way for reconstructable representation
>> of almost every python object based on python syntax then PyON is a
>> possible choice (probably in near future).
>> Also maybe in the future someone will offer better solution for
>> reconstructable representation of
>> python objects based on python syntax.
>> Also I do not think that PyON should be used instead of JSON.
> Limiting yourself to Python syntax for something that really isn't
> human readable (in particular recursive structures and arbitrary
> object serialization) doesn't make a lot of sense.  It's like limiting
> yourself to a 3rd grade vocabulary level for a doctoral dissertation
> because you think that 3rd graders might want to read it some day.
> People don't really read object representations.  And when they do,
> it's because the representations are configuration files, in which
> self-references are a *really* bad idea.
> If you want a pure-python representation (rather than json), look at
> 'unrepr'; it uses the Python parser, and by default only supports
> standard data structures.  It can be extended to support arbitrary
> classes with standard instantiation methods.
>  - Josiah

С уважением,
Шибзухов З.М.

More information about the Python-ideas mailing list