In message <roy-a0f407.20170602112...@news.panix.com>, Roy Smith wrote:
> In article <iaq5ro$vp...@lust.ihug.co.nz>, > Lawrence D'Oliveiro <l...@geek-central.gen.new_zealand> wrote: > >> In message <roy-a96d07.07462302112...@news.panix.com>, Roy Smith wrote: >> >> > In this case, I think I would do: >> > >> > styles = [("normal", "image", MainWindow.ColorsNormalList), >> > ("highlighted", "highlight", >> > MainWindow.ColorsHighlightedList), >> > ("selected", "select", MainWindow.ColorsSelectedList)] >> > >> > for in description, attr, color_list in styles: >> > blah, blah, blah >> >> And so you have managed to separate one set of looping conditions into >> two parts. What is the significance of the name “styles”? None at all. >> What purpose does it serve? None, really. Does it ease the maintenance >> burden? No, but by splitting your attention across two places, it >> actually adds to it. > > I suppose readability is in the eye of the reader, but, yes, I agree > that I have split this into two parts. The parts are > > 1) The table of data > > 2) The looping construct But the table of data makes no sense outside of the looping construct. That table does nothing other than define the bounds of the loop. Without the loop, it has no reason to exist. It makes no more sense than styles = range(0, 100) for i in styles : ... > Where we seem to disagree is whether that makes things more or less > readable :-) To me, it makes is more readable because it lets me > understand one chunk, then move on to understanding the next chunk. Which means you don’t understand the purpose of the code at all. Go look at it in its entirety, and you’ll see what I mean. <http://github.com/ldo/dvd_menu_animator> -- http://mail.python.org/mailman/listinfo/python-list