Cython has moved to github.

cython-devel

view tests/run/closures_T82.pyx @ 3439:c4ee199f08a2

closure cleanup, test
author Robert Bradshaw <robertwb@math.washington.edu>
date Thu Apr 23 03:56:04 2009 -0700 (3 years ago)
parents
children 2a13c5ad523a
line source
1 __doc__ = u"""
2 >>> f = add_n(3)
3 >>> f(2)
4 5
6 >>> a(5)()
7 8
8 """
10 def add_n(int n):
11 def f(int x):
12 return x+n
13 return f
15 def a(int x):
16 def b():
17 def c():
18 return 3+x
19 return c()
20 return b