ZeD <[EMAIL PROTECTED]> writes:
> >   desired_result = B + sorted(x for x in A if x not in B)
> this. is. cool.

Actually it's better to use a set if B is large:

  B2 = set(B)
  desired_result = B + sorted(x for x in A if x not in B2)

That avoids a linear search through B for each element of A.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to