Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ timer
Function
timer
example_code/item_047.py:93–102 ·
view source on GitHub ↗
(period)
Source
from the content-addressed store, hash-verified
91
pass
92
93
def
timer(period):
94
current = period
95
while
current:
96
try
:
97
yield
current
98
except
Reset:
99
print(
"Resetting"
)
100
current = period
101
else
:
102
current -= 1
103
104
105
print(
"Example 4"
)
Callers
1
run
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected