Cython has moved to github.
cython-devel
view tests/run/locals.pyx @ 1622:4f0327bdebc9
test for temp allocation bug in call
| author | Robert Bradshaw <robertwb@math.washington.edu> |
|---|---|
| date | Sat Jan 17 01:25:34 2009 -0800 (3 years ago) |
| parents | 3152381ccf89 |
| children | ab4e599c808d |
line source
1 __doc__ = u"""
2 >>> sorted( get_locals(1,2,3, k=5) .items())
3 [('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)]
4 """
6 import sys
7 IS_PY3 = sys.version_info[0] >= 3
9 def get_locals(x, *args, **kwds):
10 cdef int z = 5
11 if IS_PY3:
12 y = u"hi"
13 else:
14 y = "hi"
15 return locals()
17 def sorted(it):
18 l = list(it)
19 l.sort()
20 return l
