def fromstringtolist(strlist, map_function=int):
    """
    read list written as string

    map_function  function to convert from string to suited element type
    """
    if strlist in ("None", None):
        return None

    list_elems = strlist[1:-1].split(",")
    toreturn = [map_function(elem) for elem in list_elems]
    return toreturn