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:
@ -182,8 +182,9 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
|
||||
"""
|
||||
#cleanup callbackmanager of this editor
|
||||
self._cleanup_callbacks()
|
||||
for tab in [tab for tab in self.__tabs if hasattr(tab, 'callman')]:
|
||||
tab._cleanup_callbacks()
|
||||
for tab in self.__tabs:
|
||||
if hasattr(tab, 'callman'):
|
||||
tab._cleanup_callbacks()
|
||||
|
||||
def check_for_close(self, handles):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user