commafy

commafy(l: Iterable, quotes: bool = True, multi_prefix: str = '', separator: str = ', ', conjunction: str = 'and') str[source]

Convert the string list into the textual description.

Example: >>> commafy(['a','b','c']) "'a', 'b' and 'c'"

Parameters:
  • l -- Python string list.

  • quotes -- If quote is True, 'l' arg elements are enclosed in quotes by each.

  • multi_prefix -- If the 'l' arg has three or more elements, the 'multi_prefix' attach to the head.

  • separator -- The 'separator' arg is used as separator instead of ','.

  • conjunction -- The 'conjunction' arg is used as conjunction instead of 'and'.

Returns:

The textual description of the given list.