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

2009-01-27 Thread Richard Brodie
"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,

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

2009-01-27 Thread J. Cliff Dyer
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"}') > >

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

2009-01-26 Thread Miles
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

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

2009-01-26 Thread Diez B. Roggisch
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 :

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

2009-01-26 Thread Ivan Illarionov
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

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

2009-01-25 Thread Tim Roberts
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

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

2009-01-25 Thread Matt Nordhoff
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

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

2009-01-25 Thread Matt Nordhoff
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

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

2009-01-25 Thread Steven D'Aprano
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

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

2009-01-25 Thread Andreas Waldenburger
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 ? >

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

2009-01-25 Thread gert
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 :

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

2009-01-25 Thread Steve Holden
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

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

2009-01-25 Thread Gabriel Genellina
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

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

2009-01-25 Thread Andreas Waldenburger
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

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

2009-01-25 Thread Diez B. Roggisch
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

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

2009-01-25 Thread gert
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

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

2009-01-25 Thread Diez B. Roggisch
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

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

2009-01-25 Thread gert
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

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

2009-01-25 Thread Дамјан Георгиевски
> 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

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

2009-01-25 Thread J. Clifford Dyer
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

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

2009-01-25 Thread livibetter
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

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

2009-01-25 Thread Peter Otten
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