
There is that but from a math point of view the syntax a * b does make sence. Its slightly clearer and makes more sense to people from outside of a programming background. On Fri, Oct 7, 2011 at 11:35 AM, Paul Moore <p.f.moore@gmail.com> wrote:
On 7 October 2011 11:24, Jakob Bowyer <jkbbwr@gmail.com> wrote:
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.