Python: Unique items of list in the order that it appears
<p>In Python, we can get the unique items of the list using <code>set(list)</code>. However doing this breaks the order in which the values appear in the original list. Is there an elegant way to get the unique items in the order in which it appears in the list.</p>

<pre><code>l = []
for item in list_:
    if item not in l:
        l.append(item)
</code></pre>

<p>This gets slow for really big, diverse <code>list_</code>.  In those cases, it would be worth it to also keep track of a set  of seen values.</p>

python list order set unique