ordered sets operations on lists..

bonono at gmail.com bonono at gmail.com
Fri Feb 10 18:53:09 EST 2006


Raymond Hettinger wrote:
> The intersection step is unnecessary, so the answer can be simplified a
> bit:
>
> >>> filter(set(l2).__contains__, l1)
> [5, 3]
> >>> filter(set(l1).__contains__, l2)
> [3, 5]

stand corrected.




More information about the Python-list mailing list