diff options
Diffstat (limited to 'lib/sqlalchemy/ext/mutable.py')
-rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index ccaeb6aa3..b72303bc8 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -806,6 +806,10 @@ class MutableList(Mutable, list): list.extend(self, x) self.changed() + def __iadd__(self, x): + self.extend(x) + return self + def insert(self, i, x): list.insert(self, i, x) self.changed() @@ -885,6 +889,22 @@ class MutableSet(Mutable, set): set.symmetric_difference_update(self, *arg) self.changed() + def __ior__(self, other): + self.update(other) + return self + + def __iand__(self, other): + self.intersection_update(other) + return self + + def __ixor__(self, other): + self.symmetric_difference_update(other) + return self + + def __isub__(self, other): + self.difference_update(other) + return self + def add(self, elem): set.add(self, elem) self.changed() |