def _strip_top_comments ( lines : Sequence [ str ] , line_separator : str ) -> str : lines = copy . copy ( lines ) while lines and lines [ 0 ] . startswith ( "#" ) : lines = lines [ 1 : ] return line_separator . join ( lines )
delete top comment of python file
Strips # comments that exist at the top of the given lines
def _strip_top_comments(lines: Sequence[str], line_separator: str) -> str:
        """Strips # comments that exist at the top of the given lines"""
        lines = copy.copy(lines)
        while lines and lines[0].startswith("#"):
            lines = lines[1:]
        return line_separator.join(lines)