superleaf.operators.string#

Functions

str_bool_op(method, *args, **kwargs)

Predicate calling a method by name, e.g. str_bool_op("isdigit")(s) == s.isdigit().

str_op(method, *args, **kwargs)

Operator calling a method by name, e.g. str_op("lower")(s) == s.lower().

superleaf.operators.string.str_op(method: str, *args, **kwargs) → Operator[source]#

Operator calling a method by name, e.g. str_op("lower")(s) == s.lower().

Parameters:
  • method (str) – Name of the method to call on the input.

  • *args – Positional arguments passed to the method.

  • **kwargs – Keyword arguments passed to the method.

Returns:

The operator.

Return type:

Operator

superleaf.operators.string.str_bool_op(method: str, *args, **kwargs) → BooleanOperator[source]#

Predicate calling a method by name, e.g. str_bool_op("isdigit")(s) == s.isdigit().

Parameters:
  • method (str) – Name of the method to call on the input.

  • *args – Positional arguments passed to the method.

  • **kwargs – Keyword arguments passed to the method.

Returns:

The predicate.

Return type:

BooleanOperator