Simplify with built-in functions where possible. e.g.
change [x for x in y if x] to filter(None, y) change [f(x) for x in y] to map(f, x) change [x for x in y] to list(y) These changes reduce source code size and complexity and produce some minor performance gains svn: r14104
This commit is contained in:
@@ -143,7 +143,7 @@ class FanChartWidget(gtk.Widget):
|
||||
self.data = {}
|
||||
for i in range(self.generations):
|
||||
# name, person, parents?, children?
|
||||
self.data[i] = [(None, None, None, None) for j in range(2 ** i)]
|
||||
self.data[i] = [(None,) * 4] * 2 ** i
|
||||
self.angle[i] = []
|
||||
angle = 0
|
||||
slice = 360.0 / (2 ** i)
|
||||
|
Reference in New Issue
Block a user