Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/bslatkin/effectivepython
/ catching_generator
Function
catching_generator
example_code/item_089.py:95–102 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
93
94
print(
"Example 5"
)
95
def
catching_generator():
96
try
:
97
yield
40
98
yield
50
99
yield
60
100
except
BaseException
as
e:
# Catches GeneratorExit
101
print(
"Catching handler"
, type(e), e)
102
raise
103
104
105
print(
"Example 6"
)
Callers
1
item_089.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected