True
>>> add_var(10) == 1+2+10+3+4
True
+>>> neg() == -1 -2 - (-3+4)
+True
>>> mul() == 1*60*1000
True
>>> arithm() == 9*2+3*8/6-10
True
+>>> parameters() == _func(-1 -2, - (-3+4), 1*2*3)
+True
>>> lists() == [1,2,3] + [4,5,6]
True
"""
+def _func(a,b,c):
+ return a+b+c
+
def add():
return 1+2+3+4
def add_var(a):
return 1+2 +a+ 3+4
+def neg():
+ return -1 -2 - (-3+4)
+
def mul():
return 1*60*1000
def arithm():
return 9*2+3*8/6-10
+def parameters():
+ return _func(-1 -2, - (-3+4), 1*2*3)
+
def lists():
return [1,2,3] + [4,5,6]
>>> go_c_all_exprs(3)
Spam!
Spam!
+ >>> go_c_const_exprs()
+ Spam!
+ Spam!
>>> go_c_calc(2)
Spam!
Spam!
Spam!
>>> go_dict_ret()
2
+
+ >>> global_result
+ 6
"""
def go_py():
for i in range(4*x,2*x,-3):
print u"Spam!"
+def go_c_const_exprs():
+ cdef int i
+ for i in range(4*2+1,2*2,-2-1):
+ print u"Spam!"
+
def f(x):
return 2*x
for i in d:
if i > 1 and i < 3:
return i
+
+# test global scope also
+global_result = None
+cdef int i
+for i in range(4*2+1,2*2,-2-1):
+ if i < 7:
+ global_result = i
+ break