unique elements from list of lists

azrael jura.grozni at gmail.com
Sat Feb 10 23:25:04 EST 2007


no heart feelings. i was just throwing ideas. no time to testing it.


On Feb 9, 3:55 pm, "Tekkaman" <simone.... at gmail.com> wrote:
> 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





More information about the Python-list mailing list