summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/operators.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-28 14:08:28 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-28 14:08:28 -0400
commit18370ac032a84da539c54640a425c0fca7613dc9 (patch)
tree588c35d5fd126c7438bc49374f657e7edd9c055b /lib/sqlalchemy/sql/operators.py
parentd37431d7a5f7c930527ad9418756d102adebffdb (diff)
downloadsqlalchemy-18370ac032a84da539c54640a425c0fca7613dc9.tar.gz
- endless isinstance(x, str)s....
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r--lib/sqlalchemy/sql/operators.py19
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,