def sum_list(L: list) -> float:
    """
    Return sum of the numbers in L.

    L --- a possibly nested list of numbers.  L, and all sublists, are
          non-empty

    >>> sum_list([1, 2, 3])
    6
    >>> sum_list([1, [2, 3, [4]], 5])
    15
    """
    return sum( # sum of...
        # sum of sublists or else non-list elements themselves
        [sum_list(x) if isinstance(x, list) else x for x in L])

if __name__ == '__main__':
    import doctest
    doctest.testmod()
