test for ticket #537
authorStefan Behnel <scoder@users.berlios.de>
Sun, 21 Nov 2010 07:19:02 +0000 (08:19 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 21 Nov 2010 07:19:02 +0000 (08:19 +0100)
tests/run/closure_name_mangling_T537.pyx [new file with mode: 0644]

diff --git a/tests/run/closure_name_mangling_T537.pyx b/tests/run/closure_name_mangling_T537.pyx
new file mode 100644 (file)
index 0000000..f874ce1
--- /dev/null
@@ -0,0 +1,23 @@
+
+__doc__ = u"""
+>>> f1 = nested1()
+>>> f2 = nested2()
+>>> f1 == f2      # inner functions (f)
+False
+>>> f1() == f2()  # inner-inner functions (g)
+False
+"""
+
+def nested1():
+   def f():
+      def g():
+         pass
+      return g
+   return f
+
+def nested2():
+   def f():
+      def g():
+         pass
+      return g
+   return f