I\'m doing some set operations in Python, and I noticed something odd..
>> set([1,2,3]) | set([2,3,4])
set([1, 2, 3, 4])
>> set().union(*[[1,2,3], [2
set().intersection(*[[1,2,3], [2,3,4]])
is of course empty because you start with the empty set and intersect it with all the others
You can try calling the method on the class
set.intersection(*[[1,2,3], [2,3,4]])
but that won't work because the first argument passed needs to be a set
set.intersection({1, 2, 3}, *[[2,3,4], ...])
This looks awkward, better if you could use a list of sets in the first place. Especially if they are coming from a generator which makes it difficult to pull off the first item cleanly
set.intersection(*[{1,2,3}, {2,3,4}])
Otherwise you can just make them all into sets
set.intersection(*(set(x) for x in [[1,2,3], [2,3,4]]))