summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/_collections.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-12-06 13:22:59 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-12-06 13:22:59 -0500
commita8dc787ff02490da17e8704ca564bf0c6b46c04d (patch)
tree0dcecf3d0622813824398c29b3bf44518adb131a /lib/sqlalchemy/util/_collections.py
parentb53349a40389b65066fdcdd9572dd8ee052da8ff (diff)
downloadsqlalchemy-a8dc787ff02490da17e8704ca564bf0c6b46c04d.tar.gz
- [feature] IdentitySet supports the - operator
as the same as difference(), handy when dealing with Session.dirty etc. [ticket:2301]
Diffstat (limited to 'lib/sqlalchemy/util/_collections.py')
-rw-r--r--lib/sqlalchemy/util/_collections.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py
index 3adbf9913..1a965e30d 100644
--- a/lib/sqlalchemy/util/_collections.py
+++ b/lib/sqlalchemy/util/_collections.py
@@ -376,6 +376,9 @@ class IdentitySet(object):
def clear(self):
self._members.clear()
+ def __sub__(self, other):
+ return self.difference(other)
+
def __cmp__(self, other):
raise TypeError('cannot compare sets using cmp()')