"Steven D'Aprano" wrote in message
news:018d0300$0$20629$c3e8...@news.astraweb.com...
> Supposedly "every browser" (what, all of them?) already support a de
> facto extension to the JSON standard, allowing more flexible quoting.
That's a consequence of JSON being a subset of Javascript syntax,
On Sun, 2009-01-25 at 14:28 -0800, gert wrote:
> On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
> > > raise ValueError(errmsg("Expecting property name", s, end))
> > >http://docs.python.org/library/json.html
> > > What am I doing wrong ?
> >
> > try this
> > v = json.loads('{"test":"test"}')
> >
On Mon, Jan 26, 2009 at 4:06 AM, Diez B. Roggisch wrote:
> There are people who say something along the lines of "be strict when
> writing, and tolerant when reading" (the exact quote is different, but
> neither google:~site:mybrain nor any other have helped me here)
That's Postel's Law:
http://en
gert schrieb:
On Jan 26, 12:40 am, "Diez B. Roggisch" wrote:
But all of this is not JSON.
Yes it is, you just make it more python dictionary compatible :)
No, what you do is to make it more incompatible with other
json-implementations. Which defies the meaning of a standard.
Besides, {foo :
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, bu
Andreas Waldenburger wrote:
>
>But as gert says, the standard is "broken" by many many browsers
>already
We're debating relatively picky semantic point, so I won't feel bad by
being picky.
Browsers have nothing to do with the JSON standard. JSON is not
Javascript, nor is it a part of Javascri
Matt Nordhoff wrote:
> gert wrote:
>> On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
raise ValueError(errmsg("Expecting property name", s, end))
http://docs.python.org/library/json.html
What am I doing wrong ?
>>> try this
>>> v = json.loads('{"test":"test"}')
>>>
>>> JSON doesn't s
gert wrote:
> On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
>>> raise ValueError(errmsg("Expecting property name", s, end))
>>> http://docs.python.org/library/json.html
>>> What am I doing wrong ?
>> try this
>> v = json.loads('{"test":"test"}')
>>
>> JSON doesn't support single quotes, only doub
On Sun, 25 Jan 2009 19:04:44 -0500, Steve Holden wrote:
> Andreas Waldenburger wrote:
>> On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
>> wrote:
>>
>>> gert schrieb:
{'test': 'test'}
{"test": "test"}
It can not be that hard to support both notation can it ?
>>> It's n
On Sun, 25 Jan 2009 19:04:44 -0500 Steve Holden
wrote:
> Andreas Waldenburger wrote:
> > On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
> > wrote:
> >
> >> gert schrieb:
> >>> {'test': 'test'}
> >>> {"test": "test"}
> >>>
> >>> It can not be that hard to support both notation can it ?
>
On Jan 26, 12:40 am, "Diez B. Roggisch" wrote:
> >> But all of this is not JSON.
>
> > Yes it is, you just make it more python dictionary compatible :)
>
> No, what you do is to make it more incompatible with other
> json-implementations. Which defies the meaning of a standard.
>
> Besides, {foo :
Andreas Waldenburger wrote:
> On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
> wrote:
>
>> gert schrieb:
>>> {'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.
>>
> OK, playing the devil's
En Sun, 25 Jan 2009 21:08:04 -0200, gert escribió:
On Jan 25, 11:51 pm, "Diez B. Roggisch" wrote:
gert schrieb:
> On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
>>> raise ValueError(errmsg("Expecting property name", s, end))
>>>http://docs.python.org/library/json.html
>>> What am I doing wro
On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
wrote:
> gert schrieb:
> > {'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.
>
OK, playing the devil's advocate here: Doesn't practicali
But all of this is not JSON.
Yes it is, you just make it more python dictionary compatible :)
No, what you do is to make it more incompatible with other
json-implementations. Which defies the meaning of a standard.
Besides, {foo : "bar"} is *not* python dictionary compatible, at least
not
On Jan 25, 11:51 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
>
> > On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
> >>> raise ValueError(errmsg("Expecting property name", s, end))
> >>>http://docs.python.org/library/json.html
> >>> What am I doing wrong ?
> >> try this
> >> v = json.loads('{"te
gert schrieb:
On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
raise ValueError(errmsg("Expecting property name", s, end))
http://docs.python.org/library/json.html
What am I doing wrong ?
try this
v = json.loads('{"test":"test"}')
JSON doesn't support single quotes, only double quotes.
the fu
On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
> > raise ValueError(errmsg("Expecting property name", s, end))
> >http://docs.python.org/library/json.html
> > What am I doing wrong ?
>
> try this
> v = json.loads('{"test":"test"}')
>
> JSON doesn't support single quotes, only double quotes.
the f
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.python.org/library/json.html
> What am I doing wrong ?
try this
v = json.loads('{"test":"test"}')
JSON doesn't support single quotes, only double quotes.
--
дамјан ( http://softver.org.mk/damjan/ )
A: Because it revers
Please include all relevant information in the *body* of your message,
not just in the subject. It's a pain having to piece a question back
together between the subject.
On Sun, 2009-01-25 at 13:12 -0800, gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.pyth
On Jan 26, 5:12 am, gert wrote:
> raise ValueError(errmsg("Expecting property name", s,
> end))http://docs.python.org/library/json.html
> What am I doing wrong ?
You use wrong quotes, it should be wrapped by double quotes not single
quotes. Read http://json.org/:
"A string is a collection of
gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.python.org/library/json.html
> What am I doing wrong ?
You need proper quotation marks:
>>> s = json.dumps({'test':'test'})
>>> s
'{"test": "test"}'
>>> json.loads(s)
{u'test': u'test'}
The JSON format is de
22 matches
Mail list logo