Take the 2-minute tour ×  Fastest way to uniqify a list in
Python without preserving order? I saw many complicated
solutions on the Internet - could they be faster than simply:
share|improve this question Why not benchmark them and find out?
–  Chris Lutz Mar 26 '10 at 23:19 Shoot, if you need unique, why
bother converting back from a set? –  Mike DeSimone Mar 26 '10
at 23:21 2Chris: So benchmarks done... 2Mike: Because list ->
list –  Vojtech R. Mar 26 '10 at 23:58 add comment  4 Answers
up vote 18 down vote accepted set([a, b, c, a])  Leave it in
that form if possible.  share|improve this answer You can
iterate over sets and test for membership in sets, so converting
back to list if you don't need order is unnecessary. –  Chris
Lutz Mar 26 '10 at 23:51 Is fast and clear way. Thanks. – 
Vojtech R. Mar 27 '10 at 0:01 It is worth noting that this
assumes that all the elements of the list are hashable (see the
Pyhon glossary) –  Rodrigue Jun 8 '11 at 15:40 add comment
Going to a set only works for lists such