summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-02-02 16:17:58 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-02-02 16:17:58 -0500
commitcb19f227f31701322f398b5bdd77427dfc81da0d (patch)
tree644fb3803e3948888b61ff5b4af804615c66ee8a /lib/sqlalchemy/sql/expression.py
parentda3d817f3624d5f631956e33d92799572f47e52f (diff)
downloadsqlalchemy-cb19f227f31701322f398b5bdd77427dfc81da0d.tar.gz
The :meth:`.ColumnOperators.in_` operator will now coerce
values of ``None`` to :func:`.null`. [ticket:2496]
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r--lib/sqlalchemy/sql/expression.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index de728f77b..90837f4ab 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2084,6 +2084,8 @@ class _DefaultColumnComparator(operators.ColumnOperators):
raise exc.InvalidRequestError('in() function accept'
's either a list of non-selectable values, '
'or a selectable: %r' % o)
+ elif o is None:
+ o = null()
else:
o = expr._bind_param(op, o)
args.append(o)