Passing indented code to compile()

John Wilson tug at wilson.co.uk
Wed May 7 10:56:41 EDT 2003


----- Original Message ----- 
From: "Peter Hansen" <peter at engcorp.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, May 07, 2003 3:26 PM
Subject: Re: Passing indented code to compile()


[snip]


> Sorry, unnecessarily extreme statement...   XML does of course provide
> some other aspects of its design which are intended to enhance
readability.
> My point is that the "readable" goal for XML is shooting at a quite
> different level than the "readable" goal for Python.  XML is just trying
> to be readable and editable compared to binary files.  That doesn't
> necessarily involve anything like the indentation-enhanced readability
> of Python.

Tim Bray's gloss on design goal 6 of XML (XML documents should be
human-legible and reasonably clear.) is:

"Legible and Clear
This goal was motivated simply by the perception that textual formats are
more open, more useful, and more pleasant to work with than binary formats.
One of the substantial benefits of XML is that no matter how bad a day your
tools are having, you can always pull an XML document into Emacs or Notepad
or whatever your favorite editor is, and get useful work done. "



Having spent several years working with multi thousand line XML files and a
range of editors, my experience is that you need all the help you can get
with keeping track of elements. Having blocks of text sitting up against the
left margin in what is otherwise a file full of tags and attributes doesn't
really make life any easier.

What I'm trying to do is to impose as few constraints on the author of the
XML document as I can. If the author is happy with the text being left
aligned then so am I. If they are not then I'll do what I can to accommodate
them.

It's a mistake to think of the text between <execute> and </execute> as
Python code. It's text and the markup tells the XML processing program to
turn it into Python code.



John Wilson
The Wilson Partnership
http://www.wilson.co.uk







More information about the Python-list mailing list