Tempita (http://pythonpaste.org/tempita/) has a looper class that
works sort of like enumerate, but adds more:

>> for loop, i in looper('abcd'):
...     print i, loop.index, loop.odd, loop.even, loop.previous,
loop.next
...
a 0 True 0 None b
b 1 False 1 a c
c 2 True 0 b d
d 3 False 1 c None

There's more tricks than this.

Anyhow, jinja2 should pull this code in.  Or maybe there's already
something like this, and I just don't know about it.

Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to