Allowing comments after the line continuation backslash

Neil Cerutti neilc at norwich.edu
Mon Nov 8 08:29:05 EST 2010


On 2010-11-06, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
>>>     styles = [
>>>         ("normal",      "image",     MainWindow.ColorsNormalList),
>>>         ("highlighted", "highlight", MainWindow.ColorsHighlightedList),
>>>         ("selected",    "select",    MainWindow.ColorsSelectedList)]
>>
>> 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.

Some sort of comprehension test is probably required to know for
sure, but I doubt the code benefits much at all from the columns.

   styles = [
       ("normal", "image", MainWindow.ColorsNormalList),
       ("highlighted", "highlight", MainWindow.ColorsHighlightedList),
       ("selected", "select", MainWindow.ColorsSelectedList)]

Moreover, I jump the gun early on tables like this.

   styles = [csv.reader(open("styles.csv", newlines=''))]

Maybe too early. ;)

-- 
Neil Cerutti



More information about the Python-list mailing list