View Single Post
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#17
Originally Posted by aspidites View Post
I assume list comprehensions aren't used to keep things simple/terse?
Yes, the whole thing could have been written as a one-liner with list comprehension, but that is a bit scary (and sounds backwards) for many python newbies. First things first

EDIT: just for the sake of completeness:
Code:
[[led.setChecked(self.ledState) for led in row] for row in self.ledArray]
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc

Last edited by attila77; 2010-03-13 at 11:12.
 

The Following 2 Users Say Thank You to attila77 For This Useful Post: