def get_lines_without_comments(filename: str) -> List[str]:
    """
    Reads a file, and returns all lines as a list, left- and right-stripping
    the lines and removing everything on a line after the first ``#``.
    NOTE: does not cope well with quoted ``#`` symbols!
    """
    lines = []
    with open(filename) as f:
        for line in f:
            line = line.partition('#')[0]  # the part before the first #
            line = line.rstrip()
            line = line.lstrip()
            if line:
                lines.append(line)
    return lines
Reads a file, and returns all lines as a list, left- and right-stripping
    the lines and removing everything on a line after the first ``#``.
    NOTE: does not cope well with quoted ``#`` symbols!