Allowing comments after the line continuation backslash

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Nov 6 09:14:54 CET 2010


On Wed, 03 Nov 2010 12:42:49 +0000, Neil Cerutti wrote:

> On 2010-11-03, Ben Finney <ben+python at benfinney.id.au> wrote:
>> I would do the same, but fix the indentation. Making indentation depend
>> on the *length* of the previous line is needlessly making a maintenance
>> burden.
>>
>> Instead, I'd do::
>>
>>     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.

Perhaps, but lining up the columns in a 3x3 table is hardly "ornate". 

I have mixed feelings here. On the one hand, there's no doubt in my mind 
that the extra whitespace and aligned columns make the data easier to 
read for me. On the other hand, I know that it is easy to fall into the 
trap of spending hours carefully aligning code that doesn't need to be 
aligned.


-- 
Steven



More information about the Python-list mailing list