for line in file readlines if line startswith -- subtypes type append

1
2
3
4
5
6
7
8
for line in file.readlines():
if line.startswith('--'):
subtypes[type].append(line[2:])
else:
type = line[2:]
subtypes[type] = []
filter(lambda k,v: needed_subtype in v, subtypes.items())