Commit e70d0cd1 authored by Stefan Behnel's avatar Stefan Behnel

add test for using "yield from" in Python on a Cython generator

parent 863011d5
......@@ -329,7 +329,7 @@ VER_DEP_MODULES = {
(3,1): (_is_py3_before_32, lambda x: x in ['run.pyclass_special_methods',
]),
(3,3) : (operator.lt, lambda x: x in ['build.package_compilation',
'yield_from_py33',
'run.yield_from_py33',
]),
(3,4,0,'beta',3) : (operator.le, lambda x: x in ['run.py34_signature',
]),
......
# mode: run
# tag: generator
def yield_from_gen(values):
"""
>>> def yf(x): yield from x
>>> list(yf(yield_from_gen([1, 2, 3, 4])))
[1, 2, 3, 4]
"""
for value in values:
yield value
def yield_from_gen_return(values):
"""
>>> def yf(x): yield from x
>>> list(yf(yield_from_gen_return([1, 2, 3, 4])))
[1, 2, 3, 4]
"""
for value in values:
yield value
return 5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment