If you are looking for a functional approach, there is a bit more traditional than reduce() :
>>> reduce(set.union, [ set([1,2]), set([3,4]), set([5,6]) ]) set([1, 2, 3, 4, 5, 6])
In Python 3.0, reduce can be found in the functools module ; in 2.6 and 2.7, it exists both in functools and (as in older interpreters).
source share