mlrl.util.format module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides utility functions for creating textual representations.

mlrl.util.format.format_enum_values(enum: Type[Enum]) str

Creates and returns a textual representation of an enum’s values.

Parameters:

enum – The enum to be formatted

Returns:

The textual representation that has been created

mlrl.util.format.format_iterable(objects: Iterable[Any], separator: str = ', ', delimiter: str = '') str

Creates and returns a textual representation of objects in an iterable.

Parameters:
  • objects – The iterable of objects to be formatted

  • separator – The string that should be used as a separator

  • delimiter – The string that should be added at the beginning and end of each object

Returns:

The textual representation that has been created

mlrl.util.format.format_set(objects: Iterable[Any]) str

Creates and returns a textual representation of the objects in a set.

Parameters:

objects – The iterable of objects to be formatted

Returns:

The textual representation that has been created