7 Oct
2011
7 Oct
'11
1:35 p.m.
On 7 October 2011 11:24, Jakob Bowyer
Looking at this from a Math background, it seems that it would be nice for the set type to support multiplication. This would allow for the multiplication of sets to produce Cartesian products giving every single permutation. This would make set usage more intuitive for example; (assuming python3)
itertools.product does what you want already.
a = set((1,2,3)) b = set((4,5,6)) set(itertools.product(a,b)) {(2, 6), (1, 4), (1, 5), (1, 6), (3, 6), (2, 5), (3, 4), (2, 4), (3, 5)}
I don't think an operator form is sufficiently valuable when the functionality is available and clear enough already. Paul.