Commit d99d5939 authored by Stefan Behnel's avatar Stefan Behnel

extended test case

parent 9b394998
__doc__ = u""" __doc__ = u"""
>>> sorted( get_locals(1,2,3, k=5) .items()) >>> sorted( get_locals(1,2,3, k=5) .items())
[('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)] [('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)]
"""
import sys >>> in_locals('z')
IS_PY3 = sys.version_info[0] >= 3 True
>>> in_locals('args')
True
>>> in_locals('X')
False
"""
def get_locals(x, *args, **kwds): def get_locals(x, *args, **kwds):
cdef int z = 5 cdef int z = 5
if IS_PY3: y = "hi"
y = u"hi"
else:
y = "hi"
return locals() return locals()
def in_locals(x, *args, **kwds):
cdef int z = 5
y = "hi"
return x in locals()
def sorted(it): def sorted(it):
l = list(it) l = list(it)
l.sort() l.sort()
......
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