Bengt Richter wrote:

> Perhaps newbies should be advised that
>
>     [x for x in l1 if x in set(l2)]

But the resulting list is a representative of bag not a set ( contains
multiple occurrences of  elements ):

>>> [x for x in [3, 3] if s in Set([3])]
[3,3]

Same with Raymonds solution:

>>> filter(Set([3]).__contains__, [3,3]) 
[3, 3]

Kay

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to