[entity] use a list comprehension stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Apr 2011 13:05:16 +0200
branchstable
changeset 7210 29cd85f20ccb
parent 7205 9220ae2cacf1
child 7212 040d3597444f
[entity] use a list comprehension
entity.py
--- a/entity.py	Mon Apr 11 18:33:18 2011 +0200
+++ b/entity.py	Tue Apr 12 13:05:16 2011 +0200
@@ -913,9 +913,7 @@
         assert kwargs
         assert self.cw_is_saved(), "should not call set_attributes while entity "\
                "hasn't been saved yet"
-        relations = []
-        for key in kwargs:
-            relations.append('X %s %%(%s)s' % (key, key))
+        relations = ['X %s %%(%s)s' % (key, key) for key in kwargs]
         # and now update the database
         kwargs['x'] = self.eid
         self._cw.execute('SET %s WHERE X eid %%(x)s' % ','.join(relations),