List Comprehension Syntax

Isaac To iketo2 at netscape.net
Mon Jul 12 11:36:16 EDT 2004


>>>>> "Peter" == Peter Hansen <peter at engcorp.com> writes:

    Peter> If they do the alignment that way, making things carefully
    Peter> line up with the parentheses, and manually, they are
    Peter> definitely wasting their time, IMHO, because there is NO
    Peter> increase in legibility.

Except that if you write things like

a=[[[1, 2],
    [3, 4],
    [5, 6]],
   [[7, 8],
    [5, 6]],
   [9]]

as

a=[[[1, 2],
        [3, 4],
        [5, 6]],
    [[7, 8],
        [5, 6]],
    [9]]

and say there is no lose of legibility, then I'll seriously question
your taste.

BTW, for somebody with python-mode installed and is using Emacs, it is
actually *harder* and a *bigger* waste of time to write the code as
you proposed, because by default whenever you press enter the cursor
is already at exactly the location in the former style, and you got to
count spaces in order to go to the place you proposed.

Regards,
Isaac.



More information about the Python-list mailing list