[issue35756] Using `return value` in a generator function skips the returned value on for-loop iteration

2019-01-16 Thread bryan.koch
bryan.koch added the comment: I understood the PEP to include `return expr` in the iteration values as per the first bullet of the proposal. > Any values that the iterator yields are passed directly to the caller. This bullet doesn't have any additional formatting on the word "yiel

[issue35756] Using `return value` in a generator function skips the returned value on for-loop iteration

2019-01-21 Thread bryan.koch
bryan.koch added the comment: steven your generator example is exactly what I wanted to do; looks like I'm upgrading to Python 3.8 for the new assignment syntax. I was actually expecting the SyntaxError to be raised at runtime which would be a pretty large behavior change (definitely

[issue35756] Using `return value` in a generator function skips the returned value on for-loop iteration

2019-01-21 Thread bryan.koch
bryan.koch added the comment: Thanks for testing that. I'm off to write an ugly `next()` wrapper then. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35756] Using `return value` in a generator function skips the returned value on for-loop iteration

2019-01-17 Thread bryan.koch
bryan.koch added the comment: Thank you both for the clarifications. I agree these's no bug in `yield from` however is there a way to reference the return value when a generator with a return is invoked using `for val in gen` i.e. when the generator is invoked without delegation? I could