Skip to content

Commit a545e43

Browse files
committed
Test locals indside a function
1 parent da57730 commit a545e43

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/snippets/builtin_locals.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@
66

77
assert loc['a'] == 5
88
assert loc['b'] == 6
9+
10+
def f():
11+
c = 4
12+
a = 7
13+
14+
loc = locals()
15+
16+
assert loc['a'] == 4
17+
assert loc['c'] == 7
18+
assert not 'b' in loc
19+

0 commit comments

Comments
 (0)