summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r--lib/sqlalchemy/sql.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index bcb02efa4..4ac3467b2 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -283,7 +283,11 @@ class CompareMixin(object):
return self._compare('LIKE', other)
def in_(self, *other):
- if _is_literal(other[0]):
+ if len(other) == 0:
+ return self.__eq__(None)
+ elif len(other) == 1:
+ return self.__eq__(other[0])
+ elif _is_literal(other[0]):
return self._compare('IN', CompoundClause(',', other))
else:
return self._compare('IN', union(*other))