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