the indentaion for grouping thing

Anonymous anonymous at anonymous.anonymous
Sat Jun 23 14:26:21 EDT 2001


"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.993260616.23719.python-list at python.org...
> He does ignore them *now*, yes.  Do you imagine you have an argument he
> hasn't heard repeatedly in 10+ years of this?  I don't, but am willing to
be
> astonished <wink>.

Well, it's hard for me to imagine that there is
an argument that hasn't already been voiced in
all this time. Oddly, though the only
conversations I found after a while reading
google didn't address my issues.

First, in the FAQ, Guido says that because
delimiters aren't used, no disagreement can
occur between the parser and the human reader.
Say what? What's the most obvious quality of
whitespace? It's not called spaces because it
can be other characters too.

This is precisely what I don't like about
whitespace for grouping, that there is always
the potential for the parser to disagree with
the human reader. For example (you read
mail with a fixed width font right?):

if 1:
    if 0:
        print '1',
        print '2',
        print '3',
    print '4'

What does it print? The answer is any of:

2 3 4
3 4
4

The source of the ambiguity? You guessed it: The
always present python annoyance concerning the
fact that tabs typically look like spaces for
most people and their editors.

On google, I only saw conversations concerning
one author editing one file. I'm more concerned
about multiple people on multiple systems with
various editors trying to maintain the script.

Everytime I look at the file I have to think,
did someone edit this file and use spaces
instead of tabs? Did someone convert tabs to
spaces in an editor that displays a different
indent for tabs than any of other people's
editors?

If I paste code from one script into another, I
have to worry about tabs and spaces.

All answers like "just use emacs to edit your
files" don't fly because it's not just me
dealing with a script. Many unfortunate
souls simply don't have the willingness to
learn emacs.

Imagine a word processing program (bear
with me) that always prints two characters
alike, but it's a different two characters on
different systems. On my system e and a both
print as e. On my cow orker's system o and n
both print as o. So, then you always have to
worry about which systems the document has been
edited on, so that you can be suspicious of es
and as if it was modified on system a, and to
be suspicious of os and ns if it was modified on
system b. That's stupid! Ambiguity is bad
(except maybe during sex). I think python is
like this.

> Tools/scripts/pindent.py.  At the time Guido wrote that, he announced it
was
> his last word on the topic.

The think I don't like about it is that the
source file still works with plain python. I
want all people working on the script to be
required to use the preprocessor to avoid the
spaces/tabs thing with multiple users.

I want braces I guess, or some other short
delimiter, e.g.:

if 1: {
  if 0: {
    print '1',
    print '2',
    print '3',
  }
  print '4',
}

or, how about:

(if 1:
  (if 0:
    print '1',
    print '2',
    print '3',)
  print '4',)

And I want it to complain about syntax errors
regarding the delimiters. A python syntax aware
parser would be required I think.

So, then I can tell what the program means
regardless of the spaces/tabs thing.




  --------== Posted Anonymously via Newsfeeds.Com ==-------
     Featuring the worlds only Anonymous Usenet Server
    -----------== http://www.newsfeeds.com ==----------



More information about the Python-list mailing list