ResumableFunctions.jl icon indicating copy to clipboard operation
ResumableFunctions.jl copied to clipboard

Delegating to subgenerator (PEP 380)

Open lunik1 opened this issue 3 years ago • 1 comments

In Python the yield from syntax described in PEP 380 allows a generator to delegate to a subgenerator, with the subgenerator then able to yield to the caller of the original generator. This is useful for factoring code out of more complex generator functions, and when working with recursive generator functions.

Would it be possible to support delegation like this in ResumableFunctions.jl?

lunik1 avatar Jan 08 '21 19:01 lunik1

I am not familiar with this PEP. I will put this on my reading list;) Kind regards

Ben

BenLauwens avatar Jan 11 '21 12:01 BenLauwens

If this is ever implemented, it would be ideal to allow @resumables to return values (as is also part of that PEP).

gerlero avatar Nov 28 '22 16:11 gerlero