⬅︎ Back to Fastest way to uniqify a list in Python
I could explain it, but then I'd have to kill you...
>>>li=['a', 'mpilgrim', 'foo', 'b', 'c', 'b', 'd', 'd'] >>>[x for x in li if x not in locals()['_[1]']] output: ['a', 'mpilgrim', 'foo', 'b', 'c', 'd'] While, I can't explain how locals()['_[1]'] works....
Comment
I could explain it, but then I'd have to kill you...
Parent comment
>>>li=['a', 'mpilgrim', 'foo', 'b', 'c', 'b', 'd', 'd'] >>>[x for x in li if x not in locals()['_[1]']] output: ['a', 'mpilgrim', 'foo', 'b', 'c', 'd'] While, I can't explain how locals()['_[1]'] works....