MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / bool_op

Method bool_op

lib/sqlalchemy/sql/operators.py:400–425  ·  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

398 return against
399
400 def bool_op(
401 self,
402 opstring: str,
403 precedence: int = 0,
404 python_impl: Optional[Callable[..., Any]] = None,
405 ) -> Callable[[Any], Operators]:
406 """Return a custom boolean operator.
407
408 This method is shorthand for calling
409 :meth:`.Operators.op` and passing the
410 :paramref:`.Operators.op.is_comparison`
411 flag with True. A key advantage to using :meth:`.Operators.bool_op`
412 is that when using column constructs, the "boolean" nature of the
413 returned expression will be present for :pep:`484` purposes.
414
415 .. seealso::
416
417 :meth:`.Operators.op`
418
419 """
420 return self.op(
421 opstring,
422 precedence=precedence,
423 is_comparison=True,
424 python_impl=python_impl,
425 )
426
427 def operate(
428 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