[Python-ideas] Generator unpacking

Nick Coghlan ncoghlan at gmail.com
Fri Feb 12 08:22:28 EST 2016


On 12 February 2016 at 22:46, Steven D'Aprano <steve at pearwood.info> wrote:
> I'm surprised that the unpacking can't be interrupted with Ctrl-C. I
> think that is a bug.

It's a consequence of looping in C over an infinite iterator also
implemented in C - "sum(itertools.count())" will hang the same way,
since control never gets back to the eval loop to notice that Ctrl-C
has been pressed.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list