On Wed, Aug 3, 2016 at 3:57 AM, Steven D'Aprano <steve+pyt...@pearwood.info> wrote: > On Wed, 3 Aug 2016 03:12 am, BartC wrote: > >> That's not a fundamental language feature. Repeat-N is. And if properly >> designed, isn't an extra feature at all but a special case of a generic >> loop. > > Which means it is NOT a fundamental language feature. > > "Repeat N without tracking the loop variable" is just a special case > of "repeat N with tracking the loop variable", where you don't actually > care what the loop variable is.
To be fair, that can be an important distinction. I don't like seeing code like this: def f(): x = g() y = h(x) return 5 + x What's y for? Why not just call h(x) and ignore its return value? Should the last line say "5 + y"? It looks _wrong_ to have a local variable that's never used. It's still not a consideration strong enough to demand new loop syntax, though. ChrisA -- https://mail.python.org/mailman/listinfo/python-list