GeneratorExit masks StopIteration?

inyeol.lee at gmail.com inyeol.lee at gmail.com
Mon Jan 30 01:38:26 EST 2017


On Sunday, January 29, 2017 at 9:54:44 PM UTC-8, Chris Angelico wrote:
> ...
> When you close() a generator, it raises GeneratorExit into it, and
> then silences any StopIteration or GeneratorExit that comes out of it.

Chris,
Thanks for the info. Is this (GenExit silencing StopIteration) documented somewhere?
I was suspecting this but couldn't find any reference.



More information about the Python-list mailing list