summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-04-24 15:52:42 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-04-24 15:52:42 -0400
commitf7e89f887fa411d00f4df84315170369bc752885 (patch)
tree2dda1ff4ad2d5aafab22faf90a7466ddd1d3fc9c
parente73f735382371ac5c05a46f2a51fd10971270fe4 (diff)
parente77cf339ee504ca9973d88e486d174f1ffa87302 (diff)
downloadsqlalchemy-f7e89f887fa411d00f4df84315170369bc752885.tar.gz
Merge remote-tracking branch 'origin/pr/169'
-rw-r--r--lib/sqlalchemy/util/_collections.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py
index 4fb12d71b..db2c21949 100644
--- a/lib/sqlalchemy/util/_collections.py
+++ b/lib/sqlalchemy/util/_collections.py
@@ -743,15 +743,16 @@ _property_getters = PopulateDict(
def unique_list(seq, hashfunc=None):
- seen = {}
+ seen = set()
+ seen_add = seen.add
if not hashfunc:
return [x for x in seq
if x not in seen
- and not seen.__setitem__(x, True)]
+ and not seen_add(x)]
else:
return [x for x in seq
if hashfunc(x) not in seen
- and not seen.__setitem__(hashfunc(x), True)]
+ and not seen_add(hashfunc(x))]
class UniqueAppender(object):