finesse.utilities.text.option_list

finesse.utilities.text.option_list(sequence, final_sep='or', quotechar=None)[source]

Build a list from sequence with commas and a final “or”.

As in Python’s error messages (e.g. “‘func’ missing 3 requied positional arguments: ‘a’, ‘b’, and ‘c’”), this function adds an Oxford comma for sequences of length > 2.

Parameters:
sequencesequence

The options to create a list with.

final_sepstr, optional

The final separator when sequence has more than one item. Defaults to or.

quotecharstr, optional

Quote the items in sequence with this character. Defaults to no quotes.