filter list fast

lars_woetmann larswp at gmail.com
Sat Mar 18 04:54:40 EST 2006


I have a list I filter using another list and I would like this to be
as fast as possible
right now I do like this:

[x for x in list1 if x not in list2]

i tried using the method filter:

filter(lambda x: x not in list2, list1)

but it didn't make much difference, because of lambda I guess
is there any way I can speed this up




More information about the Python-list mailing list