Passing indented code to compile()
John Wilson
tug at wilson.co.uk
Wed May 7 11:05:39 EDT 2003
That's certainly one way to do it.
Personally I prefer my way :-)
I really think you are on pretty shaky ground claiming that the whitespace
is not semantically significant. The XML spec doesn't support your assertion
at all as far as I can see. An XML parser has to be very careful to pass all
the whitespace to the application unless it's validating the document
against a DTD and then it can throw a limited amount away in special
circumstances.
One has similar problems when marking up poetry.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
----- Original Message -----
From: "Harvey Thomas" <hst at empolis.co.uk>
To: "John Wilson" <tug at wilson.co.uk>; <skip at pobox.com>
Cc: <python-list at python.org>
Sent: Wednesday, May 07, 2003 3:35 PM
Subject: RE: Passing indented code to compile()
[snip]
XML, from it's SGML document background is intended to markup the structure
of a document, not its presentation, so in the true spirit of XML the
fragment:
[fragment removed]
The indentation is purely for aesthetic purposes, and if all white space
between tags were removed, the document would be structurally the same. I
don't find the above very readable. In my view XML is not a good vehicle for
representing Python code.
More information about the Python-list
mailing list