Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz/python-cookbook
/ add_logging
Function
add_logging
src/10/monkeypatching_modules_on_import/example2.py:14–16 ·
view source on GitHub ↗
(mod)
Source
from the content-addressed store, hash-verified
12
# Example
13
@when_imported(
'math'
)
14
def
add_logging(mod):
15
mod.cos = logged(mod.cos)
16
mod.sin = logged(mod.sin)
17
18
if
__name__ ==
'__main__'
:
19
import
math
Callers
nothing calls this directly
Calls
1
logged
Function · 0.70
Tested by
no test coverage detected