Use built-in functions to replace for loops:

Old code:

for x in y:
  f(x)

New Code:

map(f, y)

Also use defaultdict instead of simple dict when advantageous and use list comprehensions
instead of for loops where map() could be used but requires lambdas.


svn: r14135
This commit is contained in:
Gerald Britton
2010-01-25 17:45:21 +00:00
parent fbb8fa2a52
commit 8f0582df8a
49 changed files with 125 additions and 188 deletions

View File

@@ -2039,8 +2039,7 @@ class GeoView(HtmlView):
self.vbox.destroy()
except: # pylint: disable-msg=W0704
pass # pylint: disable-msg=W0702
for child in self.hpaned.get_children(): # cleanup
self.hpaned.remove(child)
map(self.hpaned.remove, self.hpaned.get_children())
self.vbox = gtk.VBox()
self.hpaned.pack_start(self.vbox, True, True)
self.filter_sidebar = filter_class(self.dbstate, self.uistate,