On Tue, 02 Nov 2010 11:16:46 +1300, Lawrence D'Oliveiro wrote: > In message <4cce6ff6.2050...@v.loewis.de>, Martin v. Loewis wrote: > >> (in fact, I can't think any situation where I would use the backslash). > > for \ > Description, Attr, ColorList \ > in \ > ( > ("normal", "image", MainWindow.ColorsNormalList), > ("highlighted", "highlight", > MainWindow.ColorsHighlightedList), ("selected", "select", > MainWindow.ColorsSelectedList), > ) \ > : > ... > #end for
If it were your intention to show why backslashes should be avoided, you succeeded admirably. The above can be written much more cleanly as: for Description, Attr, ColorList in ( ("normal", "image", MainWindow.ColorsNormalList), ("highlighted", "highlight", MainWindow.ColorsHighlightedList), ("selected", "select", MainWindow.ColorsSelectedList), ): pass with no backslashes required. An even better way would be to given the tuples descriptive names, so that anyone maintaining this software can easily see what they are for: # States should be tuples (description, attribute name, colour list). standard = ("normal", "image", MainWindow.ColorsNormalList) highlighted = ("highlighted", "highlight", MainWindow.ColorsHighlightedList) selected = ("selected", "select", MainWindow.ColorsSelectedList) for desc, attr, color_list in (standard, highlighted, selected): pass -- Steven -- http://mail.python.org/mailman/listinfo/python-list