From ee13f54f750f9713f649ddcd9c7318c08584e6b4 Mon Sep 17 00:00:00 2001 From: Vitja Makarov Date: Wed, 30 Mar 2011 10:46:48 +0200 Subject: [PATCH] Add testcase for cdef class method with closure --- tests/run/closure_self.pyx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/run/closure_self.pyx diff --git a/tests/run/closure_self.pyx b/tests/run/closure_self.pyx new file mode 100644 index 00000000..78c544e1 --- /dev/null +++ b/tests/run/closure_self.pyx @@ -0,0 +1,11 @@ +cdef class SelfInClosure(object): + """ + >>> o = SelfInClosure() + >>> o.closure_method()() == o + True + """ + + def closure_method(self): + def nested(): + return self + return nested -- 2.26.2