From e12f3edf338e1e72bbdb4f1d476fceda6e8c4d6a Mon Sep 17 00:00:00 2001 From: Vitja Makarov Date: Sat, 29 Jan 2011 15:02:17 +0300 Subject: [PATCH] Add test for lambda inside generator --- tests/run/generators.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.26.2