Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Generators and iterators
What happens when StopIteration escapes directly from a generator function body in Python…
from Generators and iterators
Python 3.14
intermediate
1 min
What happens when StopIteration escapes directly from a generator function body in Python 3.14?
It becomes RuntimeError at the generator-frame boundary.
It always ends the generator silently.
It becomes GeneratorExit.
Python yields the exception object as the next item.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the file-line generator
Spot the bug
A new version is available
Reload