finding the intersection of a list of Sets

Raymond Hettinger python at rcn.com
Tue Jan 31 12:34:34 EST 2006


That should have been:

>>> sets.sort(key=len)
>>> reduce(set.intersection, sets)

The only refinement was the pre-sort based on set length.




More information about the Python-list mailing list