Terry J. Reedy added the comment: (One copy of a message is enough; I unlinked the duplicate.)
I am not sure what you mean by you initial sentence, but I do not think it is correct. In any case, "next(it) for it in iters" is a generator expression, not a list comprehension. The tuple call swallows the StopIteration, so the behavior is correct. If you want to discuss further, please ask on python-list, also accessible at news.gmane.com either as a web page or as newsgroup gmane.comp.python.general. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed title: Catching StopIteraion inside list comprehension -> Catching StopIteraion inside generator expression. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22761> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com