From: Stefan Behnel Date: Thu, 25 Nov 2010 14:32:22 +0000 (+0100) Subject: additional closure tests X-Git-Tag: 0.14.alpha0~85 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8f516cc5758d04cf96932726f84cec4bada85739;p=cython.git additional closure tests --- diff --git a/tests/run/closures_T82.pyx b/tests/run/closures_T82.pyx index de634856..cb7f9c1c 100644 --- a/tests/run/closures_T82.pyx +++ b/tests/run/closures_T82.pyx @@ -184,3 +184,31 @@ def more_inner_funcs(x): # called with (2,4,8) return f(a_f), g(b_g), h(b_h) return resolve + +def deep_inner(): + """ + >>> deep_inner()() + 2 + """ + cdef int x = 1 + def f(): + def g(): + def h(): + return x+1 + return h + return g() + return f() + +def deep_inner_sibling(): + """ + >>> deep_inner_sibling()() + 2 + """ + cdef int x = 1 + def f(): + def g(): + return x+1 + def h(): + return g() + return h + return f()