[Python-ideas] Implement __add__ for set and frozenset
arnodel at googlemail.com
Tue Jun 3 20:32:53 CEST 2008
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)
>> A = S.union(T)
> 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
A ^ (B ^ B) = A but (A ^ B) ^ B = A | B
More information about the Python-ideas