Is there a Pythonic equivalent to Ruby's #each_cons?
#each_cons
In Ruby you can do this:
array = [1,2,3,4] array.each_cons(2).to_a => [[1,2],[2,3],[3,4]]