On Aug 2, 2019, at 15:45, Steven D'Aprano <st...@pearwood.info> wrote: > > Are infinite for-loops that common that people get excited by cycle? > That sounds like the "here's a hammer, now every problem is a nail" > issue. "itertools.cycle is cool, I must use it as often as possible!"
Well, they’re probably excited that the function they spent the last three hours debugging some fence post error on can be replaced by a single line, not that every program for the rest of their life will be similarly improved. (Once you get the itertools way of doing things, a whole lot of programs for the rest of your life _are_ similarly improved. But I don’t think cycle is enough to get that across. If someone wants to learn more, I usually point them to… I don’t have the links with me, but it’s Generator Tools for Systems Programmers v2, and something that was part of the pitch for yield from that I can’t remember.) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ALMCUV32DZF25EQMH6P24KDVJV2LQGAN/ Code of Conduct: http://python.org/psf/codeofconduct/