[Python-ideas] PEP 426, YAML in the stdlib and implementation discovery

Vito De Tullio vito.detullio at gmail.com
Sat Jun 1 18:29:09 CEST 2013


Yuval Greenfield wrote:

>> > It's simpler, it's Python syntax, it's faster to parse.
>>
>> I would warn strongly against the "JSON is Python syntax" meme.
>>
>>
> Another warning - this javascript tidbit broke my heart more times than I
> care to admit:
> 
>>var k = 'foo'
>>var obj = {k: 'wonderful'}
>>obj[k]
> undefined
>>obj['k']
> "wonderful"

*sigh* brother!

worse if instead of a generic k you have:

var MY_CONFIGURATION_CONSTANT = 'foo';

fortunately JSON does not allow unquoted keys (and variables...) so at least 
his behaviour does not make surprises.

-- 
ZeD




More information about the Python-ideas mailing list