On 2010-03-02 11:59 AM, Terry Reedy wrote:
On 3/2/2010 11:34 AM, Robert Kern wrote:
On 2010-03-01 22:55 PM, Terry Reedy wrote:
On 3/1/2010 7:56 PM, Patrick Maupin wrote:
On Mar 1, 5:57 pm, Erik Max Francis<m...@alcyone.com> wrote:
Patrick Maupin wrote:
This not only seriously stretching the meaning of the term "superset"
(as Python is most definitely not even remotely a superset of JSON),
but

Well, you are entitled to that opinion, but seriously, if I take valid
JSON, replace unquoted true with True, unquoted false with False,
replace unquoted null with None, and take the quoted strings and
replace occurrences of \uXXXX with the appropriate unicode, then I do,
in fact, have valid Python. But don't take my word for it -- try it
out!

To me this is so strained that I do not see why why you are arguing the
point. So what? The resulting Python 'program' will be equivalent, I
believe, to 'pass'. Ie, construct objects and then discard them with no
computation or output.

Not if you eval() rather than exec().

 >>> eval(1)

creates and objects and discards it, with a net result of 'pass'.
What do you think I am missing.

x = eval('1')

It's reasonably well-accepted that
JSON is very close to being a subset of Python's expression syntax with
just a few modifications.

It is specifically JavaScript Object Notation, which is very similar to
a subset of Python's object notation (number and string literals and
list and dict displays (but not set displays), and three named
constants). Without operators, it barely qualifies, to me, even as
'expression syntax'.

Literal expression syntax, then.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to