<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif">On Wed, Oct 18, 2017 at 2:38 PM, Steven D'Aprano </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Oct 18, 2017 at 01:39:28PM +0300, Koos Zevenhoven wrote:<br>
<br>
> I'm writing from my phone now, cause I was dumb enough to try list(count())<br>
<br>
You have my sympathies -- I once, due to typo, accidentally ran<br>
something like range(10**100) in Python 2.<br>
<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​Oh, I think I've done something like that too, and there are definitely still opportunities in Python 3 to ask for the impossible. But what I did now, I did "on purpose".​ For a split second, I really wanted to know how bad it would be. But a few minutes later I had little interest left in that ;). Rebooting a computer definitely takes longer than restarting a Python process.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> But should it be fixed in list or in count?<br>
<br>
Neither. There are too many other places this can break for it to be<br>
effective to try to fix each one in place.<br>
<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​To clarify, I was talking about allowing Ctrl-C to break it, which somebody had suggested. That would also help if the C-implemented iterable just takes a lot of time to generate the items.</div></div><div><br></div><div class="gmail_default" style="font-family:monospace,monospace">​And for the record, I just tried</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">>>> sum(itertools.count())</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">And as we could expect, it does not respect Ctrl-C either. <br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">––Koos</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br clear="all"><div><br></div>-- <br><div class="m_5998268801183203075m_1262700818990339757m_-806643305384129333gmail_signature" data-smartmail="gmail_signature">+ Koos Zevenhoven + <a href="http://twitter.com/k7hoven" target="_blank">http://twitter.com/k7hoven</a> +</div>
</div></div>