Posts tagged “Exceptions”
3 posts Subscribe by RSS
3 posts
Where does a Python generator's return value go? StopIteration.value and PEP 479
A generator's return value never shows up in a for loop; it rides on StopIteration.value. How yield from gets it, why StopIteration in a generator becomes RuntimeError, and what close() returns.
How a Python with block swallows exceptions: __exit__ return values and return in finally
When __exit__ returns a true value, the with statement suppresses the exception. How that differs from return in finally, and how to write a suppressor that catches only what you mean.
Where does the close() exception go? Reading suppressed exceptions in Java try-with-resources
When both the try block and close() throw, which exception propagates and which ends up in getSuppressed()? Close order and multiple failures, per JLS 14.20.3.
No posts match. Try another word.