diff options
Diffstat (limited to 'lib/sqlalchemy/orm/unitofwork.py')
-rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 5e66653a3..9a8c02b6b 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -411,9 +411,9 @@ class UOWTransaction: if cycles: # if yes, break the per-mapper actions into # per-state actions - convert = dict( - (rec, set(rec.per_state_flush_actions(self))) for rec in cycles - ) + convert = { + rec: set(rec.per_state_flush_actions(self)) for rec in cycles + } # rewrite the existing dependencies to point to # the per-state actions for those per-mapper actions @@ -435,9 +435,9 @@ class UOWTransaction: for dep in convert[edge[1]]: self.dependencies.add((edge[0], dep)) - return set( - [a for a in self.postsort_actions.values() if not a.disabled] - ).difference(cycles) + return { + a for a in self.postsort_actions.values() if not a.disabled + }.difference(cycles) def execute(self) -> None: postsort_actions = self._generate_actions() @@ -478,9 +478,9 @@ class UOWTransaction: return states = set(self.states) - isdel = set( + isdel = { s for (s, (isdelete, listonly)) in self.states.items() if isdelete - ) + } other = states.difference(isdel) if isdel: self.session._remove_newly_deleted(isdel) |