def stripComments(self, lines):
        """
        Strip comments from C{lines}.

        @param lines: lines to work on
        @type lines: iterable of L{bytes}

        @return: C{lines} sans comments.
        """
        return (
            a.find(b';') == -1 and a or a[:a.find(b';')] for a in [
                b.strip() for b in lines
            ]
        )

        Strip comments from C{lines}.

        @param lines: lines to work on
        @type lines: iterable of L{bytes}

        @return: C{lines} sans comments.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/authority.py