RAM leak?

I ran example.py using docker and my RAM skyrocketed until it ram [sic] out (24 GB). I traced it to range rather than xrange. Once python 3 is targeted some compat will be needed since range was dropped and xrange became range.

I also edited the output to (hopefully) make it more clear what is going on.