From: Vitja Makarov Date: Sat, 29 Jan 2011 12:02:17 +0000 (+0300) Subject: Add test for lambda inside generator X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e12f3edf338e1e72bbdb4f1d476fceda6e8c4d6a;p=cython.git Add test for lambda inside generator --- diff --git a/tests/run/generators.pyx b/tests/run/generators.pyx index 0060eba3..b38a48b4 100644 --- a/tests/run/generators.pyx +++ b/tests/run/generators.pyx @@ -307,3 +307,11 @@ def test_nested_gen(int n): """ for a in range(n): yield (b for b in range(a)) + +def test_lambda(n): + """ + >>> [i() for i in test_lambda(3)] + [0, 1, 2] + """ + for i in range(n): + yield lambda : i