Support generator returns when used with yield from.

This commit is contained in:
Dave Halter
2018-02-28 22:35:58 +01:00
parent 80ee3b8fcf
commit 0d0213ee4c
3 changed files with 60 additions and 4 deletions

View File

@@ -223,9 +223,42 @@ next(yield_from())
def yield_from_multiple():
yield from iter([1])
yield str()
return 2.0
x, y = yield_from_multiple()
#? int()
x
#? str()
y
def test_nested():
x = yield from yield_from_multiple()
#? float()
x
yield x
x, y, z = yield_nested()
#? int()
x
#? str()
y
# For whatever reason this is currently empty
#?
z
def test_in_brackets():
x = 1 + (yield from yield_from_multiple())
#? float()
x
generator = (1 for 1 in [1])
x = yield from generator
#? None
x
x = yield from 1
#?
x
x = yield from [1]
#? None
x