n_elements = 0
n_rows = 0
for line in file:
items = set(mo.group(1).strip()
for mo in self.re_name.finditer(line))
names.update(items)
n_elements += len(items)
n_rows += 1
After Change
names = set()
classes = set()
file.seek(0)
reader = csv.reader(file)
for line in reader:
names.update(mo.split("=")[0] for mo in line)
n_elements += len(line)
return names - classes, classes, n_elements, reader.line_num, header