From: Stefan Behnel Date: Mon, 22 Nov 2010 07:45:19 +0000 (+0100) Subject: Py3 locals test X-Git-Tag: 0.14.alpha0~99^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f5911810363aaca58a343e8788f83b29e6be9ef9;p=cython.git Py3 locals test --- diff --git a/tests/run/cython3.pyx b/tests/run/cython3.pyx index 04a569bb..17129986 100644 --- a/tests/run/cython3.pyx +++ b/tests/run/cython3.pyx @@ -17,6 +17,19 @@ def print_function(*args): """ print(*args) # this isn't valid Py2 syntax +def locals_function(a, b=2): + """ + >>> items = list(locals_function(1).items()) + >>> items.sort() + >>> for item in items: + ... print('%s = %r' % item) + a = 1 + b = 2 + x = 'abc' + """ + x = 'abc' + return locals() + def exec3_function(cmd): """ >>> exec3_function('a = 1+1')['a']