diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-04 10:44:37 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-04 10:44:37 -0400 |
commit | bc9ff8fcc9e13fe50714c95e3f56c9144aba94f5 (patch) | |
tree | 7879eadd68a537ca4531ac48793222fc8d507dea /lib/sqlalchemy/sql/operators.py | |
parent | 9e612f111b9645f4958e3ef0595d9e19bd9e5ae3 (diff) | |
download | sqlalchemy-bc9ff8fcc9e13fe50714c95e3f56c9144aba94f5.tar.gz |
`lshift` (<<) and `rshift` (>>) are also supported as optional operators.
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index ba33d016a..38936231d 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -11,7 +11,7 @@ from operator import ( and_, or_, inv, add, mul, sub, mod, truediv, lt, le, ne, gt, ge, eq, neg, - getitem + getitem, lshift, rshift ) # Py2K @@ -315,6 +315,24 @@ class ColumnOperators(Operators): """ return self.operate(getitem, index) + def __lshift__(self, other): + """implement the << operator. + + Not used by SQLAlchemy core, this is provided + for custom operator systems which want to use + << as an extension point. + """ + return self.operate(lshift, other) + + def __rshift__(self, other): + """implement the >> operator. + + Not used by SQLAlchemy core, this is provided + for custom operator systems which want to use + >> as an extension point. + """ + return self.operate(rshift, other) + def concat(self, other): """Implement the 'concat' operator. |