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:
@@ -103,10 +103,9 @@ class TableReport(object):
|
||||
def set_row(self,val):
|
||||
self.row = val + 2
|
||||
|
||||
def write_table_head(self,data):
|
||||
def write_table_head(self, data):
|
||||
self.doc.start_row()
|
||||
for item in data:
|
||||
self.doc.write_cell(item)
|
||||
map(self.doc.write_cell, data)
|
||||
self.doc.end_row()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user