I saw a one liner code that is claimed to remove duplicates from a sequence:
u = [x for x in seq if x not in locals()[\'_[1]\']]
I tried th
locals()['_[1]'] is a way to access a reference to list comprehension (or generator) current result inside that list comprehension.
It is quite an evil, but can produce funny results:
>> [list(locals()['_[1]']) for x in range(3)]
[[], [[]], [[], [[]]]]
See more details here: the-secret-name-of-list-comprehensions.