Allowing comments after the line continuation backslash

Robert Kern robert.kern at
Wed Nov 10 01:05:26 CET 2010

On 11/9/10 4:51 PM, Mark Wooding wrote:
> Lawrence D'Oliveiro<ldo at geek-central.gen.new_zealand>  writes:
>> In message<87fwvdb69k.fsf.mdw at>, Mark Wooding
>> wrote:
>>> for descr, attr, colours in [
>>>          ('normal',      'image',        'Normal'),
>>>          ('highlighted', 'highlight',    'Highlighted'),
>>>          ('selected',    'select',       'Selected')]:
>>>    colourlist = getattr(MainWindow, 'Colors%sList' % colours)
>>>    ## ...
>> But then you lose the ability to match up the bracketing symbols.
> You're right.  I do.
>> That’s why I put them on lines by themselves.
> But the bracketing symbols are thoroughly uninteresting!  All that
> putting them on their own lines achieves is to draw attention to the
> scaffolding at the expense of the building.  It's great if you like the
> Pompidou Centre, I suppose...

For me, putting the brackets on their own lines (and using a trailing comma) has 
little to do with increasing readability. It's for making editing easier. 
Keeping all of the items consistent means that in order to add, delete, or move 
any item is the same operation everywhere in the list whether it is the first 
item, last item, or any item in between.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list