On 2010-11-02 19:46 , Ben Finney wrote:

Instead, I'd do::

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

I'd go one step further:

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

Keeping the []s separate from the items and using the trailing comma means that I can easily add new items or reorder the items.

--
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

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to