def ignore_comments(lines_enum):
 for (line_number, line) in lines_enum:
  line = COMMENT_RE.sub('', line)
  line = line.strip()
  if line:
   (yield (line_number, line))

def ignore_comments ( lines_enum ) : for ( line_number , line ) in lines_enum : line = COMMENT_RE . sub ( '' , line ) line = line . strip ( ) if line : ( yield ( line_number , line ) )
strips comments and filter empty lines .