cdef int ai, bi
cdef long al, bl
cdef object ao, bo
- cdef int side_effect_count = call_count
+ reset()
ai, bi = al, bl = ao, bo = c = d = [intval(1), intval(2)]
- side_effect_count = call_count - side_effect_count
- return side_effect_count, ao, bo, ai, bi, al, bl, c, d
+ return call_count, ao, bo, ai, bi, al, bl, c, d
def recursive_parallel_assignment_from_call_left():
"""
"""
cdef int ai, bi, ci
cdef object ao, bo, co
- cdef int side_effect_count = call_count
+ reset()
(ai, bi), ci = (ao, bo), co = t,o = d = [(intval(1), intval(2)), intval(3)]
- side_effect_count = call_count - side_effect_count
- return side_effect_count, ao, bo, co, ai, bi, ci, t, o, d
+ return call_count, ao, bo, co, ai, bi, ci, t, o, d
def recursive_parallel_assignment_from_call_right():
"""
"""
cdef int ai, bi, ci
cdef object ao, bo, co
- cdef int side_effect_count = call_count
+ reset()
ai, (bi, ci) = ao, (bo, co) = o,t = d = [intval(1), (intval(2), intval(3))]
- side_effect_count = call_count - side_effect_count
- return side_effect_count, ao, bo, co, ai, bi, ci, o, t, d
+ return call_count, ao, bo, co, ai, bi, ci, o, t, d
def recursive_parallel_assignment_from_call_left_reversed():
"""
"""
cdef int ai, bi, ci
cdef object ao, bo, co
- cdef int side_effect_count = call_count
+ reset()
d = t,o = (ao, bo), co = (ai, bi), ci = [(intval(1), intval(2)), intval(3)]
- side_effect_count = call_count - side_effect_count
- return side_effect_count, ao, bo, co, ai, bi, ci, t, o, d
+ return call_count, ao, bo, co, ai, bi, ci, t, o, d
def recursive_parallel_assignment_from_call_right_reversed():
"""
"""
cdef int ai, bi, ci
cdef object ao, bo, co
- cdef int side_effect_count = call_count
+ reset()
d = o,t = ao, (bo, co) = ai, (bi, ci) = [intval(1), (intval(2), intval(3))]
- side_effect_count = call_count - side_effect_count
- return side_effect_count, ao, bo, co, ai, bi, ci, o, t, d
+ return call_count, ao, bo, co, ai, bi, ci, o, t, d
cdef int call_count = 0
+cdef int next_expected_arg = 1
-cdef int intval(int x):
- global call_count
+cdef reset():
+ global call_count, next_expected_arg
+ call_count = 0
+ next_expected_arg = 1
+
+cdef int intval(int x) except -1:
+ global call_count, next_expected_arg
call_count += 1
+ assert next_expected_arg == x, "calls not in source code order: expected %d, found %d" % (next_expected_arg, x)
+ next_expected_arg += 1
return x