summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_scope.py')
-rw-r--r--Lib/test/test_scope.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 358c45a..c42d881 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -436,3 +436,14 @@ verify(d.has_key('h'))
del d['h']
verify(d == {'x': 2, 'y': 7, 'w': 6})
+print "19. var is bound and free in class"
+
+def f(x):
+ class C:
+ def m(self):
+ return x
+ a = x
+ return C
+
+inst = f(3)()
+verify(inst.a == inst.m())