
June 3, 2008
6:32 p.m.
On 3 Jun 2008, at 19:04, Raymond Hettinger wrote:
Perhaps it would be nice to have set.union (and set.intersection) to accept more than one argument, i.e. have A = S.union(T, U, V) mean A = S.union(T) A.update(U) A.update(V)
Something like this has been on my todo list for a while.
Patches are welcome. It should be done for union, intersection, difference, and symmetric difference.
Difference is not an associative operation though. E.g. A - (B - B) = A but (A - B) - B = A - B Same for symmetric difference (here "^" stands for symmetric difference). E.g. A ^ (B ^ B) = A but (A ^ B) ^ B = A | B -- Arnaud