[Python-ideas] Generator unpacking

Steven D'Aprano steve at pearwood.info
Fri Feb 12 12:49:08 EST 2016


On Fri, Feb 12, 2016 at 08:39:53AM -0800, Guido van Rossum wrote:
> On Fri, Feb 12, 2016 at 5:22 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > 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.
> 
> We should occasionally check for signals in such loops. We do that in
> other places.


http://bugs.python.org/issue26351



-- 
Steve


More information about the Python-ideas mailing list