From d5c80a3da7c144da2519a019eac788fd09158cdd Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 27 Jan 2011 14:01:47 -0800 Subject: [PATCH] Nested generator test. --- tests/run/generators.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/run/generators.pyx b/tests/run/generators.pyx index af8926c8..0060eba3 100644 --- a/tests/run/generators.pyx +++ b/tests/run/generators.pyx @@ -299,3 +299,11 @@ def test_inside_lambda(): ('a', 'b') """ return lambda:((yield 1), (yield 2)) + +def test_nested_gen(int n): + """ + >>> [list(a) for a in test_nested_gen(5)] + [[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3]] + """ + for a in range(n): + yield (b for b in range(a)) -- 2.26.2