[Python-ideas] Possible new itertool: comm()

Chris Angelico rosuav at gmail.com
Tue Jan 6 17:47:52 CET 2015


On Wed, Jan 7, 2015 at 3:46 AM, Chris Angelico <rosuav at gmail.com> wrote:
>>>> def count_by(x):
>     n = 0
>     while True:
>         n += x
>         yield n

And thanks to the magic of sloppy editing, I just rewrote
itertools.count(). In my own testing, there was a print call to show
what the internal iterators were yielding, but that got left out,
leaving this looking a little silly. Anyhow.

ChrisA


More information about the Python-ideas mailing list