MCPcopy 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
94print("Example 5")
95def 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
105print("Example 6")

Callers 1

item_089.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected