v = json.loads("{'test':'test'}")

Ivan Illarionov ivan.illarionov at gmail.com
Mon Jan 26 03:18:17 EST 2009


Diez wrote:
> gert schrieb:
> > Single quotes works in every browser that support json so i
> > recommended python should support it too, besides it looks much
> > cleaner
> > {'test': 'test'}
> > {"test": "test"}
>
> > It can not be that hard to support both notation can it ?
>
> It's not hard, but it's not standard-conform.
>
> Most browsers even accept something like this:
>
> {foo : "bar"}
>
> But all of this is not JSON.

By the way, all of this *is* YAML:

>>> yaml.load("{'test':'test'}")
{'test': 'test'}
>>> yaml.load("{test: test}")
{'test': 'test'}

If someone needs more forgiving and user-editable format,
YAML might be a good choice.

--
Ivan



More information about the Python-list mailing list