bytewax._utils#

Small generic utility functions.

Data#

X: TypeVar#

Functions#

partition(
it: Iterable[bytewax._utils.X],
predicate: Callable[[bytewax._utils.X], bool],
) Tuple[List[bytewax._utils.X], List[bytewax._utils.X]]#

Split an iterable in two based on a predicate.

Parameters:
  • it – Input iterable.

  • predicate – Call this on each item.

Returns:

A list of items for which the predicate is true, and a list for which it is false.

Join our community Slack channel

Need some help? Join our community!

If you have any trouble with the process or have ideas about how to improve this document, come talk to us in the #questions-answered Slack channel!

Join now