mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
Support generator returns when used with yield from.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user