for outfielders in it.combinations(of_pool - playing, 3):
    roster[5:8] = outfielders
all_rosters.append(roster[:])
if len(all_rosters) > 10 ** 6:
    f.writelines(repr(roster) + '\n' for roster in all_rosters)
all_rosters = []
f.writelines(repr(roster) + '\n' for roster in all_rosters)
end = time.time()
elapsed = end - start
assert all(len(set(roster)) == len(roster) == 8 for roster in all_rosters)
assert len(all_rosters) == len(set(tuple(roster) for roster in all_rosters))
print(len(all_rosters))
print(elapsed)
цикл, чтобы сделать каждую комбинацию из нескольких списков