[Python-ideas] Support multiplication for sets
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Oct 7 23:33:05 CEST 2011
Jakob Bowyer wrote:
> There is that but from a math point of view the syntax a * b does make
> sence.
A problem with this is that it doesn't generalise smoothly
to products of more than two sets.
A mathematician would think of A x B x C as a set of 3-tuples,
but in Python, A * B * C implemented the straightforward way
would give you a set of 2-tuples, one element of which is
another 2-tuple.
Keeping it as a function allows products of arbitrarily many
sets to be expressed naturally.
--
Greg
More information about the Python-ideas
mailing list