from functools import reduce
pieces.append(Piece('three', 'x', 'n', 'p'))
l = [combinations(pieces, i) for i in range(2, 4)]
flat = []
for i in l:
    for k in i:
        flat.append(k)
for f in flat:
    print('-' * 25)
print([j._tag for j in f])
dicts = (i._dict for i in f)
matches = reduce(lambda x, y: x & y, dicts)
print(matches)
Python: подмножества данных с наиболее распространенными записями