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:
@ -370,10 +370,9 @@ class RecordsReport(Report):
|
||||
|
||||
self.callname = menu.get_option_by_name('callname').get_value()
|
||||
|
||||
self.include = {}
|
||||
for (text, varname, default) in RECORDS:
|
||||
self.include[varname] = menu.get_option_by_name(varname).get_value()
|
||||
|
||||
self.include = dict([varname,
|
||||
menu.get_option_by_name(varname).get_value()]
|
||||
for (_1, varname, _3) in RECORDS)
|
||||
|
||||
def write_report(self):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user