Allowing comments after the line continuation backslash

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Nov 7 07:33:52 CET 2010


In message <roy-0ED9F0.08443706112010 at news.panix.com>, Roy Smith wrote:

> In article <ib2vrb$3eq$4 at lust.ihug.co.nz>,
>  Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> wrote:
> 
>> In message <8jd3m9Fr55U7 at mid.individual.net>, Neil Cerutti wrote:
>> 
>> > On 2010-11-03, Ben Finney <ben+python at benfinney.id.au> wrote:
>> >
>> >>     styles = [
>> >>         ("normal",      "image",     MainWindow.ColorsNormalList),
>> >>         ("highlighted", "highlight",
>> >>         MainWindow.ColorsHighlightedList),
>> >>         ("selected",    "select",    MainWindow.ColorsSelectedList)]
>> > 
>> > Agreed, except cute stuff like putting those three items in
>> > columns is just as bad.
>> > 
>> > Code should be utilitarian rather than ornate, Shaker rather than
>> > Victorian.
>> 
>> Tufte’s concept of “chartjunk” could perhaps be extended to “formatjunk”
>> or “prettyprintjunk”.
> 
> Not at all.  Tufte is all about making data easy to understand visually.
> The chartjunk he rails about is colors, shadows, 3-d effects, etc, which
> make a chart "look pretty" but don't add to comprehension.

Precisely my point.

> If you take out the extra whitespace, you end up with this:
> 
>> >>     styles = [
>> >>         ("normal", "image", MainWindow.ColorsNormalList),
>> >>         ("highlighted", "highlight",
>> >>         MainWindow.ColorsHighlightedList), ("selected", "select",
>> >>         MainWindow.ColorsSelectedList)]
> 
> which I think is more difficult to scan visually.

Not surprising, since the above list has become completely divorced from its 
original purpose. Anybody remember what that was? It was supposed to be used 
in a loop, as follows:

    for \
        Description, Attr, ColorList \
    in \
        (
            ("normal", "image", MainWindow.ColorsNormalList),
            ("highlighted", "highlight", MainWindow.ColorsHighlightedList),
            ("selected", "select", MainWindow.ColorsSelectedList),
        ) \
    :
       ...
    #end for

Does this make more sense now?




More information about the Python-list mailing list