[Python-ideas] Membership of infinite iterators

Koos Zevenhoven k7hoven at gmail.com
Wed Oct 18 06:39:28 EDT 2017

On Oct 18, 2017 13:29, "Nick Coghlan" <ncoghlan at gmail.com> wrote:

On 18 October 2017 at 19:56, Koos Zevenhoven <k7hoven at gmail.com> wrote:

> I'm unable to reproduce the "uninterruptible with Ctrl-C"​ problem with
> infinite iterators. At least itertools doesn't seem to have it:
> >>> import itertools
> >>> for i in itertools.count():
> ...     pass
> ...

That's interrupting the for loop, not the iterator. This is the test case
you want for the problem Jason raised:

    >>> "a" in itertools.count()

Be prepared to suspend and terminate the affected process, because Ctrl-C
isn't going to help :)

I'm writing from my phone now, cause I was dumb enough to try list(count())

But should it be fixed in list or in count?

-- Koos

PS. Nick, sorry about the duplicate email.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171018/19e70ba5/attachment.html>

More information about the Python-ideas mailing list