MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / test2

Function test2

src/9/executing_code_with_local_side_effects/example.py:13–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 print(x) # --> 0
12
13def test2():
14 x = 0
15 loc = locals()
16 print('before:', loc)
17 exec('x += 1')
18 print('after:', loc)
19 print('x =', x)
20
21def test3():
22 x = 0

Callers 1

example.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected