[Python-ideas] Python Object Notation (PyON)
josiah.carlson at gmail.com
Wed Nov 5 22:44:45 CET 2008
On Wed, Nov 5, 2008 at 11:10 AM, Zaur Shibzoukhov <szport at gmail.com> wrote:
> 2008/11/5 Josiah Carlson <josiah.carlson at gmail.com>:
>> Adding *yet another* Python-centric serialization language seems more
>> than a little silly to me; it seems like a waste of time. Of course
>> you are free to develop this method as you see fit, but don't be
>> surprised if you bring it to python-dev and they say, "no."
> PyON is just that-born. The PyON concept and it's implementation is at
> an early stage.
> Therefore, it too early offer python-dev.
> Personally I don't consider PyON as another serialization language. I
> would like to see it as literal object notation based on python
> syntax. Currently, this is not possible, because it is necessary to
> expand the syntax of the python language. I don't expect this soon.
> At this stage PyON uses the existing syntax of python language for the
> human readable/writeble literal representation of objects.
> I hope that one day someone will propose to expand the syntax of the
> language and introduce literal notation for objects representation
> embedded into python language.
Python already has a literal syntax for describing objects in-line in
the language. It's the syntax itself, and repr(obj) (given proper
__repr__ methods) can give you everything you need, except for
recursive and multi-referenced objects.
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).
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?
More information about the Python-ideas