From 9785287b3ae00c7bff3cd777f2931f54d359c344 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 21 Nov 2010 08:19:02 +0100 Subject: [PATCH] test for ticket #537 --- tests/run/closure_name_mangling_T537.pyx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/run/closure_name_mangling_T537.pyx diff --git a/tests/run/closure_name_mangling_T537.pyx b/tests/run/closure_name_mangling_T537.pyx new file mode 100644 index 00000000..f874ce14 --- /dev/null +++ b/tests/run/closure_name_mangling_T537.pyx @@ -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 -- 2.26.2