commafy

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

Convert the string list into the textual description.

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

Parameters:
  • l (Iterable) -- Python string list.

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

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

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

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

Returns:

The textual description of the given list.

Return type:

str