MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / bool_op

Method bool_op

lib/sqlalchemy/sql/operators.py:314–339  ·  view source on GitHub ↗

Return a custom boolean operator. This method is shorthand for calling :meth:`.Operators.op` and passing the :paramref:`.Operators.op.is_comparison` flag with True. A key advantage to using :meth:`.Operators.bool_op` is that when using column constructs, t

(
        self,
        opstring: str,
        precedence: int = 0,
        python_impl: Optional[Callable[..., Any]] = None,
    )

Source from the content-addressed store, hash-verified

312 return against
313
314 def bool_op(
315 self,
316 opstring: str,
317 precedence: int = 0,
318 python_impl: Optional[Callable[..., Any]] = None,
319 ) -> Callable[[Any], Operators]:
320 """Return a custom boolean operator.
321
322 This method is shorthand for calling
323 :meth:`.Operators.op` and passing the
324 :paramref:`.Operators.op.is_comparison`
325 flag with True. A key advantage to using :meth:`.Operators.bool_op`
326 is that when using column constructs, the "boolean" nature of the
327 returned expression will be present for :pep:`484` purposes.
328
329 .. seealso::
330
331 :meth:`.Operators.op`
332
333 """
334 return self.op(
335 opstring,
336 precedence=precedence,
337 is_comparison=True,
338 python_impl=python_impl,
339 )
340
341 def operate(
342 self, op: OperatorType, *other: Any, **kwargs: Any

Callers 8

test_return_typesMethod · 0.45
sql_operations.pyFile · 0.45
operators.pyFile · 0.45
test_or_tsqueryMethod · 0.45
test_match_customMethod · 0.45

Calls 1

opMethod · 0.95

Tested by 6

test_return_typesMethod · 0.36
test_or_tsqueryMethod · 0.36
test_match_customMethod · 0.36