Thanks everybody! Azrael: your suggestions involve python-level membership testing and dummy list construction just like my uniter3 example, so I'm afraid they would not go any faster. There's no built-in sequence flattening function that I know of btw. bearophile: your implementation is very similar to my uniter2 (subsequent set unions) but without the additional lambda def overhead, and in fact it goes faster. Not faster than uniter though. Peter: your solution is the fastest, removing the explicit for loop resulted in a 30% speed gain. Looks like using set() is a must.
-- Simone -- http://mail.python.org/mailman/listinfo/python-list