From 399170727c19cb447b759a42414cf25a28f9b76a Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 20 Apr 2023 10:28:35 +0800 Subject: [PATCH] ... --- tests/45_yield.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/45_yield.py b/tests/45_yield.py index 65430e33..40e3cdcc 100644 --- a/tests/45_yield.py +++ b/tests/45_yield.py @@ -36,4 +36,13 @@ def f(): yield from g() a = [i for i in f()] -assert a == [1, 2, 3] \ No newline at end of file +assert a == [1, 2, 3] + +def f(n): + for i in range(n): + yield i + for j in range(i): + yield j + +t = f(3) +assert list(t) == [0, 1, 0, 2, 0, 1] \ No newline at end of file