JuliaDynamics / ResumableFunctions.jl

C# style generators a.k.a. semi-coroutines for Julia.
Other
158 stars 19 forks source link

Delegating to subgenerator (PEP 380) #49

Closed lunik1 closed 1 year ago

lunik1 commented 3 years ago

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?

BenLauwens commented 3 years ago

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

Ben

gerlero commented 1 year ago

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