Fredrik Lundh <[EMAIL PROTECTED]> writes: > > desired_result = B + sorted(x for x in A if x not in B) > assuming that "keep the existing order" means what it says, you might > as well replace "sorted" with a list comprehension.
Hmm. I didn't read it that way, but yeah, if that's what the OP meant then the sort could be skipped. I thought he just wanted a stable sort, which the sorting primitives now promise. -- http://mail.python.org/mailman/listinfo/python-list