
June 30, 2013
10:40 p.m.
On 30 June 2013 23:24, Andrew Barnert <abarnert@yahoo.com> wrote:
I think a lot of people are looking at this wrong. In list(genexp), it's not the genexp part that's doing anything here; it's the list function. There's no way that it could distinguish between an explicit StopIteration and an implicit one, so it treats them the same way. If a comprehension is supposed to be the same as list(genexp) it should act like list--or like any other iteration mechanism you can write in Python or even in C--rather than acting magically as it currently does.
Damnit, you're so obviously right. Yeah, fine. Whatever.