> How about a listcomprehension?
> 
> 
> new_list = [e for e in old_list if predicate(e)]
> # Possibly you need this, too:
> old_list[:] = new_list


forgot the predicate. And you should use a set of objects to remove, as then
you'd have O(1) behavior for the in-operator

So:

to_remove = set(b)
new_list = [e for e in a if e not in to_remove]

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

Reply via email to