Python Gotcha's?

Roy Smith roy at panix.com
Thu Apr 5 14:07:23 EDT 2012


In article <jlkh1c$msc$1 at mx1.internetia.pl>,
 Grzegorz Staniak <gstaniak at gmail.com> wrote:

> On 05.04.2012, Roy Smith <roy at panix.com> wroted:
> 
> > There's absolutely no reason why JSON should follow Python syntax
> > rules. Making it support either kind of quotes would have
> > complicated every JSON library in the world, for no added value.
> 
> I think these days it's not just "Python syntax", it's kinda something
> that you can get accustommed to take for granted. Realistically, how
> much more complication could the support for either quote marks
> introduce? I doubt anyone would even notice. And you don't have to
> write JSON by hand for this gotcha to bite you, all it takes is to
> start playing with generating JSON without the use of specialized 
> JSON libraries/functions. For testing, for fun, out of curiosity...

If you want to talk a protocol, read the protocol specs and follow them.  
Don't just look at a few examples, guess about the rules, and then act 
surprised when your guess turns out to be wrong.

If you don't want to take the trouble to read and understand the 
protocol specs, use a library written by somebody who has already done 
the hard work for you.



More information about the Python-list mailing list