summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r--lib/sqlalchemy/sql/expression.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index 1ceaa9191..46a08379b 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2011,8 +2011,10 @@ class _DefaultColumnComparator(operators.ColumnOperators):
return op, other_comparator.type
def _boolean_compare(self, expr, op, obj, negate=None, reverse=False,
+ _python_is_types=(util.NoneType, bool),
**kwargs):
- if isinstance(obj, (util.NoneType, bool, Null, True_, False_)):
+
+ if isinstance(obj, _python_is_types + (Null, True_, False_)):
# allow x ==/!= True/False to be treated as a literal.
# this comes out to "== / != true/false" or "1/0" if those
@@ -2054,7 +2056,8 @@ class _DefaultColumnComparator(operators.ColumnOperators):
type_=sqltypes.BOOLEANTYPE,
negate=negate, modifiers=kwargs)
- def _binary_operate(self, expr, op, obj, reverse=False, result_type=None):
+ def _binary_operate(self, expr, op, obj, reverse=False, result_type=None,
+ **kw):
obj = self._check_literal(expr, op, obj)
if reverse: