Python Gotcha's?

Barry W Brown brownbar at gmail.com
Fri Apr 6 20:48:41 EDT 2012


On Thursday, April 5, 2012 11:28:01 PM UTC-5, rusi wrote:
> On Apr 5, 4:06 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
> > Steven D'Aprano <steve+comp.lang.pyt... at pearwood.info> wrote:
> > > JSON expects double-quote marks, not single:
> > >     v = json.loads("{'test':'test'}")  fails
> > >     v = json.loads('{"test":"test"}')  succeeds
> >
> > You mean JSON expects a string with valid JSON?
> > Quelle surprise.
> 
> Are there languages (other than python) in which single and double
> quotes are equivalent?

Fortran 90 and more recent versions.
> 
> [No I dont claim to know all the languages out there, just that I dont
> know any other language which allows single and double quotes to be
> interconvertible like python does]



On Thursday, April 5, 2012 11:28:01 PM UTC-5, rusi wrote:
> On Apr 5, 4:06 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
> > Steven D'Aprano <steve+comp.lang.pyt... at pearwood.info> wrote:
> > > JSON expects double-quote marks, not single:
> > >     v = json.loads("{'test':'test'}")  fails
> > >     v = json.loads('{"test":"test"}')  succeeds
> >
> > You mean JSON expects a string with valid JSON?
> > Quelle surprise.
> 
> Are there languages (other than python) in which single and double
> quotes are equivalent?
> 
> [No I dont claim to know all the languages out there, just that I dont
> know any other language which allows single and double quotes to be
> interconvertible like python does]




More information about the Python-list mailing list