summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_scope.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 34801bd..f37254c 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -440,6 +440,15 @@ vereq(test(6)(2), 8)
x = -1
vereq(test(3)(2), 5)
+looked_up_by_load_name = False
+class X:
+ # Implicit globals inside classes are be looked up by LOAD_NAME, not
+ # LOAD_GLOBAL.
+ locals()['looked_up_by_load_name'] = True
+ passed = looked_up_by_load_name
+
+verify(X.passed)
+
print "18. verify that locals() works"
def f(x):