efficient list merging

John La Rooy igetenoughspamalreadythanksjlr at doctor.com
Tue Sep 3 17:33:33 CEST 2002


François Pinard wrote:

> Taking advantage of other clever suggestions, I would guess that:
> 
>     both = list1 + list2
>     result = dict(zip(both, both)).keys()
> 
> would not be so bad, speed-wise.
>

result=dict(zip(list1,list1))
result.update(dict(zip(list2,list2)))

John




More information about the Python-list mailing list