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:
Gerald Britton
2010-01-21 18:42:53 +00:00
parent fdfb1b48b0
commit 1f2469b09f
38 changed files with 81 additions and 101 deletions

View File

@@ -149,7 +149,7 @@ class TextBufDoc(BaseDoc, TextDoc):
tab_array = pango.TabArray(len(new_tabs)+1,True)
index = 0
for tab in [ pixels(x) for x in new_tabs ]:
for tab in map(pixels, new_tabs):
tab_array.set_tab(index, pango.TAB_LEFT, tab)
index += 1
tag.set_property("tabs", tab_array)