diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-28 14:08:28 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-28 14:08:28 -0400 |
commit | 18370ac032a84da539c54640a425c0fca7613dc9 (patch) | |
tree | 588c35d5fd126c7438bc49374f657e7edd9c055b /lib/sqlalchemy/sql/operators.py | |
parent | d37431d7a5f7c930527ad9418756d102adebffdb (diff) | |
download | sqlalchemy-18370ac032a84da539c54640a425c0fca7613dc9.tar.gz |
- endless isinstance(x, str)s....
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index cf1c484d0..4afb3db48 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -9,16 +9,19 @@ """Defines operators used in SQL expressions.""" +from .. import util + + from operator import ( and_, or_, inv, add, mul, sub, mod, truediv, lt, le, ne, gt, ge, eq, neg, getitem, lshift, rshift ) -# start Py2K -#from operator import (div,) -# end Py2K +if util.py2k: + from operator import div +else: + div = truediv -from ..util import symbol class Operators(object): @@ -781,17 +784,15 @@ parenthesize (a op b). """ -_smallest = symbol('_smallest', canonical=-100) -_largest = symbol('_largest', canonical=100) +_smallest = util.symbol('_smallest', canonical=-100) +_largest = util.symbol('_largest', canonical=100) _PRECEDENCE = { from_: 15, getitem: 15, mul: 8, truediv: 8, -# start Py2K -# div: 8, -# end Py2K + div: 8, mod: 8, neg: 8, add: 7, |