[issue35966] Didn't raise "StopIteration" Error when I use "yield" in the function

SilentGhost report at bugs.python.org
Mon Feb 11 08:46:42 EST 2019


SilentGhost <ghost.adh at runbox.com> added the comment:

Within a generator function, StopIteration exception is a sign that generator is finished. This is why this exception is caught automatically, and closes generator. This is normal and documented behaviour of generators.

----------
nosy: +SilentGhost, sheiun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35966>
_______________________________________


More information about the Python-bugs-list mailing list