I am using Python 2.5, I want an enumeration like so (starting at 1 instead of 0):
[(1, 2000), (2, 2001), (3, 2002), (4, 2003), (5, 2004)]
from itertools import count, izip def enumerate(L, n=0): return izip( count(n), L) # if 2.5 has no count def count(n=0): while True: yield n n+=1
Now h = list(enumerate(xrange(2000, 2005), 1)) works.
h = list(enumerate(xrange(2000, 2005), 1))