-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Description
YieldFrom (yield_from) statements in noworkflow do not capture the value.
yield from range(5)| name | type | composition_type |
|---|---|---|
| yield from range(5) | expr | value |
| yield from range(5) | yield_from |
Unlike yield_from, the yield statement captures the value
yield i| name | type | composition_type |
|---|---|---|
| yield i | expr | value |
| yield i | yield | value |
| i | name |
Similar to yield, yield_from should captures the value, as demonstrated in the example below using ast.dump:
Module(
body=[
Expr(
value=YieldFrom(
value=Call(
func=Name(id='range', ctx=Load()),
args=[
Constant(value=5)],
keywords=[])))],
type_ignores=[])
In noworkflow, the equivalent result should be:
| name | type | composition_type |
|---|---|---|
| yield from range(5) | expr | value |
| yield from range(5) | yield_from | value |
| range(5) | call | *args |
| ... | ... | ... |
Reactions are currently unavailable