You will need two loops (or, which is the same thing, a loop and listcomp, as shown below), but not nested:
import collections d = collections.defaultdict(int) for x in L: d[x] += 1 L[:] = [x for x in L if d[x] == 1]
This solution assumes that the list items are hashable, i.e. they can be used as indexes in dicts, members of collections, etc.
The OP indicates that they care about the IDENTITY object, not VALUE (for example, two sub-lists, both merits [1,2,3 , which are equal but may not match, will not be considered duplicate). If this is true, then this code can be used, just replace d[x] with d[id(x)] in both cases and it will work for ANY type of object in the list L.
Mutable objects (lists, dicts, sets, ...) are usually not hashed and therefore cannot be used this way. User objects by default hashable (with hash(x) == id(x) ), unless their class defines special comparison methods ( __eq__ , __cmp__ , ...), in which case they are hashed if and only if their class also defines __hash__ .
If the elements of the list L are not hashed but comparable for inequality (and therefore sorted) and you do not care about your order in the list, you can complete the task in O(N log N) by first sorting the list and then applying itertools.groupby (almost, but not quite, as another answer suggested).
Other approaches, gradually decreasing characteristics and increasing generality, can deal with non-expandable sorts when you take care of the initial order of the list (make a sorted copy and in the second cycle check the repetitions on it with bisect - also O (N log N), but a little slower) and with objects whose only applicable property is that they are comparable for equality (in no way can the dangerous performance of O (N ** 2) be avoided in this maximally general case).
If the OP can clarify which case relates to its specific problem, I will be happy to help (and, in particular, if the objects in it are hashable, the code that I have already indicated above should be sufficient ;-).