Simple syntax for bringing a list element to the front in python?
<p>I have an array with a set of elements.  I'd like to bring a given element to the front but otherwise leave the order unchanged.  Do folks have suggestions as to the cleanest syntax for this?</p>

<p>This is the best I've been able to come up with, but it seems like bad form to have an N log N operation when an N operation could do.</p>

<pre><code>    mylist = sorted(mylist,
                    key=lambda x: x == targetvalue,
                    reverse=True)
</code></pre>

<p>Cheers,
/YGA</p>
