<div class="gmail_quote">On Wed, Dec 16, 2009 at 5:39 AM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@remove-this-cybersource.com.au">steve@remove-this-cybersource.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

for item in seq[1:]:<br>
    process(item)<br>
<br>
without making an unnecessary copy of almost all of seq.<br></blockquote></div><br>I use the following idiom:<br>for i in range(1, len(seq)):<br>    process(seq[i])<br><br>Alternately, if I'm using the blist extension type that I wrote, then seq[1:] is O(log n).<br>
<a href="http://pypi.python.org/pypi/blist/">http://pypi.python.org/pypi/blist/</a><br><blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>