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:
@@ -67,7 +67,7 @@ class AttributeBase(object):
|
||||
"""
|
||||
Convert a serialized tuple of data to an object.
|
||||
"""
|
||||
self.attribute_list = [Attribute().unserialize(item) for item in data]
|
||||
self.attribute_list = map(Attribute().unserialize, data)
|
||||
|
||||
def add_attribute(self, attribute):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user