MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __and__

Method __and__

lib/sqlalchemy/sql/operators.py:198–221  ·  view source on GitHub ↗

Implement the ``&`` operator. When used with SQL expressions, results in an AND operation, equivalent to :func:`_expression.and_`, that is:: a & b is equivalent to:: from sqlalchemy import and_ and_(a, b) Care should b

(self, other: Any)

Source from the content-addressed store, hash-verified

196 __slots__ = ()
197
198 def __and__(self, other: Any) -> Operators:
199 """Implement the ``&`` operator.
200
201 When used with SQL expressions, results in an
202 AND operation, equivalent to
203 :func:`_expression.and_`, that is::
204
205 a & b
206
207 is equivalent to::
208
209 from sqlalchemy import and_
210
211 and_(a, b)
212
213 Care should be taken when using ``&`` regarding
214 operator precedence; the ``&`` operator has the highest precedence.
215 The operands should be enclosed in parenthesis if they contain
216 further sub expressions::
217
218 (a == 2) & (b == 4)
219
220 """
221 return self.operate(and_, other)
222
223 def __or__(self, other: Any) -> Operators:
224 """Implement the ``|`` operator.

Callers

nothing calls this directly

Calls 1

operateMethod · 0.95

Tested by

no test coverage detected