Whenever you write `for i in range(len(...))`, you should immediately know that you are doing it wrong. Just do `for limit in expr.limits`.  If you need the index as well (which here you don't), use enumerate.