Iterate a list as pair (current, next) in Python
<p>I sometimes need to iterate a list in python looking at the "current" element and the "next" element. I have, till now, done so with code like:</p>

<pre><code>for current, next in zip(the_list, the_list[1:]):
    # do something
</code></pre>

<p>This works and does what I expect -- just wondering if there's a more idiomatic or efficient way to do the same thing.</p>
