diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-04-27 10:26:10 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-04-27 16:08:02 -0400 |
commit | 433d2ee9f14a028399e848f3552a1a71f223c976 (patch) | |
tree | 09d891438679797eaab358ccd866589ca372a831 /lib/sqlalchemy/sql/operators.py | |
parent | 1b63306a973f13588216fbb097b6dffb4a5c4c63 (diff) | |
download | sqlalchemy-433d2ee9f14a028399e848f3552a1a71f223c976.tar.gz |
Enforce boolean result type for all eq_, is_, isnot, comparison
Repaired issue where the type of an expression that used
:meth:`.ColumnOperators.is_` or similar would not be a "boolean" type,
instead the type would be "nulltype", as well as when using custom
comparison operators against an untyped expression. This typing can
impact how the expression behaves in larger contexts as well as
in result-row-handling.
Change-Id: Ib810ff686de500d8db26ae35a51005fab29603b6
Fixes: #3873
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 49642acdd..58f32b3e6 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -1021,7 +1021,8 @@ def json_path_getitem_op(a, b): _commutative = {eq, ne, add, mul} -_comparison = {eq, ne, lt, gt, ge, le, between_op, like_op} +_comparison = {eq, ne, lt, gt, ge, le, between_op, like_op, is_, + isnot, is_distinct_from, isnot_distinct_from} def is_comparison(op): |