3 ms·
(nonsense deleted)
by klmr 7y ago
(nonsense deleted)
- kd5bjo 7y agoPython for loops aren’t actually bounded: if the iterator you’re looping over doesn’t terminate then neither will the loop. It also only calls the iterator’s next() method once per loop, so it’s possible for the body of a loop to affect future iterations by mutating the iterator.
- klmr 7y agoYou’re right, of course. I had completely forgotten that.
- bjoli 7y agoI saw this before you deleted it, and i just wanted to say that I would much rather compile to tail recursion than a while loop, but I generally try to avoid explicit mutation (being a scheme guy)