def makelist(inlist):
    """Given a list - will turn it into a string... suitable for writing out.
    (and then reparsing with listparse.)

    Uses list_stringify to make sure all elements are strings and
    elem_quote to decide the most appropriate quoting.

    (This means it adds quoting to every element and, where necessary, escapes
    '"' as '&mjf-quot;' and '\n' as '&mjf-lf;'........)."""
    inlist = list_stringify(inlist)
    outline = '['
    if not inlist:         # the member is set to None or is an empty list
        outline += ']'
    else:
        for item in inlist:
            if not isinstance(item, list):
                outline += elem_quote(item)
                outline += ', '
            else:
                outline += makelist(item)
                outline += ', '
        if outline[-2:] == ', ':
            outline = outline[:-2]
        outline += ']'
    return outline
Given a list - will turn it into a string... suitable for writing out.
    (and then reparsing with listparse.)

    Uses list_stringify to make sure all elements are strings and
    elem_quote to decide the most appropriate quoting.

    (This means it adds quoting to every element and, where necessary, escapes
    '"' as '&mjf-quot;' and '
' as '&mjf-lf;'........).
recipes/Python/281056_Listparse/recipe-281056.py