def list_to_string(inlist, endsep="and", addquote=False):
    """
    This pretty-formats a list as string output, adding an optional
    alternative separator to the second to last entry.  If `addquote`
    is `True`, the outgoing strings will be surrounded by quotes.
    Args:
        inlist (list): The list to print.
        endsep (str, optional): If set, the last item separator will
            be replaced with this value. Oxford comma used for "and" and "or".
        addquote (bool, optional): This will surround all outgoing
            values with double quotes.
    Returns:
        liststr (str): The list represented as a string.
    Examples:
        ```python
         # no endsep:
            [1,2,3] -> '1, 2, 3'
         # with endsep=='and':
            [1,2,3] -> '1, 2, and 3'
         # with endsep=='that delicious':
            [7,8,9] -> '7, 8 that delicious 9'
         # with addquote and endsep
            [1,2,3] -> '"1", "2" and "3"'
        ```
    """
    if not endsep:
        endsep = ","
    elif endsep in ("and", "or") and len(inlist) > 2:
        endsep = ", " + endsep
    else:
        endsep = " " + endsep
    if not inlist:
        return ""
    if addquote:
        if len(inlist) == 1:
            return "\"%s\"" % inlist[0]
        return ", ".join("\"%s\"" % v for v in inlist[:-1]) + "%s %s" % (endsep, "\"%s\"" % inlist[-1])
    else:
        if len(inlist) == 1:
            return str(inlist[0])
        return ", ".join(str(v) for v in inlist[:-1]) + "%s %s" % (endsep, inlist[-1])