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,
)
| 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 |