class_docstr: Utility class for the `when-then-otherwise` expression.
  
  Represents the state of the expression after `pl.when(...).then(...)` is called.
class_docstr_tok: ["Utility","class","for","the","`","when-then-otherwise","`","expression",".","Represents","the","state","of","the","expression","after","`","pl.when","(","...",")",".then","(","...",")","`","is","called","."]
docstr: Add a condition to the `when-then-otherwise` expression.
  
  Parameters
  ----------
  predicates
      Condition(s) that must be met in order to apply the subsequent statement.
      Accepts one or more boolean expressions, which are implicitly combined with
      `&`. String input is parsed as a column name.
  constraints
      Apply conditions as `colname = value` keyword arguments that are treated as
      equality matches, such as `x = 123`. As with the predicates parameter,
      multiple conditions are implicitly combined using `&`.
docstr_tok: ["Add","a","condition","to","the","`","when-then-otherwise","`","expression",".","Parameters","--","--","--","--","--","predicates","Condition","(","s",")","that","must","be","met","in","order","to","apply","the","subsequent","statement",".","Accepts","one","or","more","boolean","expressions",",","which","are","implicitly","combined","with","`","&","`",".","String","input","is","parsed","as","a","column","name",".","constraints","Apply","conditions","as","`","colname","=","value","`","keyword","arguments","that","are","treated","as","equality","matches",",","such","as","`","x","=","123","`",".","As","with","the","predicates","parameter",",","multiple","conditions","are","implicitly","combined","using","`","&","`","."]
code: def when(
      self,
      *predicates: IntoExpr | Iterable[IntoExpr],
      **constraints: Any,
  ) -> ChainedWhen:
      """
      Add a condition to the `when-then-otherwise` expression.
  
      Parameters
      ----------
      predicates
          Condition(s) that must be met in order to apply the subsequent statement.
          Accepts one or more boolean expressions, which are implicitly combined with
          `&`. String input is parsed as a column name.
      constraints
          Apply conditions as `colname = value` keyword arguments that are treated as
          equality matches, such as `x = 123`. As with the predicates parameter,
          multiple conditions are implicitly combined using `&`.
  
      """
      condition_pyexpr = parse_when_constraint_expressions(
          *predicates, **constraints
      )
      return ChainedWhen(self._then.when(condition_pyexpr))
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Iterable
  import polars.functions
  from polars.expr.expr import Expr
  from polars.utils._parse_expr_input import parse_as_expression, parse_when_constraint_expressions
  from polars.utils._wrap import wrap_expr
label_desc: Use image node_id 4 for calling the Then obj's underlying member method code with example usage: obj.when() and returns: ChainedWhen