Commit a687fae6 authored by Robert Bradshaw's avatar Robert Bradshaw

Another closure test.

parent 83910594
...@@ -6,7 +6,6 @@ unsignedbehaviour_T184 ...@@ -6,7 +6,6 @@ unsignedbehaviour_T184
missing_baseclass_in_predecl_T262 missing_baseclass_in_predecl_T262
cfunc_call_tuple_args_T408 cfunc_call_tuple_args_T408
cpp_structs cpp_structs
closure_inside_cdef_T554
genexpr_iterable_lookup_T600 genexpr_iterable_lookup_T600
generator_expressions_in_class generator_expressions_in_class
for_from_pyvar_loop_T601 for_from_pyvar_loop_T601
......
...@@ -38,3 +38,19 @@ cdef class SelfInClosure(object): ...@@ -38,3 +38,19 @@ cdef class SelfInClosure(object):
def nested(): def nested():
return self.x, t.x return self.x, t.x
return nested return nested
def call_closure_method_cdef_attr_c(self, Test t):
"""
>>> o = SelfInClosure()
>>> o.call_closure_method_cdef_attr_c(Test())()
(1, 2)
"""
return self.closure_method_cdef_attr_c(t)
cdef closure_method_cdef_attr_c(self, Test t):
t.x = 2
self._t = t
self.x = 1
def nested():
return self.x, t.x
return nested
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment