[Python-ideas] Uniquify attribute for lists
Robrecht De Rouck
de.rouck.robrecht at gmail.com
Fri Nov 16 13:28:46 CET 2012
I just wanted to bring to your attention that an *attribute for removing
duplicate elements* for lists would be a nice feature.
seen = set()
seen_add = seen.add
return [ x for x in lis if x not in seen and not seen_add(x)]*
The code is from this
check out this performance
It would be useful to have a uniquify attribute for containers in general.
Best regards, Robrecht
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas