Sure, there are many ways to do it, but I think the author was going for speed here.
The OP's question of is this genius or bad is clear in that regard: it is bad, due to not being the proper optimization direction, but it is interesting.
Maybe I'm doing crazy stuff, though!
http://docs.python.org/2/library/itertools.html#itertools.iz...
EDIT: See update above.