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:
@ -241,7 +241,7 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
|
||||
:returns: Returns the list of child objects that may carry textual data.
|
||||
:rtype: list
|
||||
"""
|
||||
add_list = [item for item in self.lds_ord_list if item]
|
||||
add_list = filter(None, self.lds_ord_list)
|
||||
return self.media_list + self.attribute_list + \
|
||||
self.source_list + add_list
|
||||
|
||||
|
Reference in New Issue
Block a user