Reducing "yield from" overhead in recursive generators

2022-03-17 Thread Rathmann
Summary: I am looking for feedback on a potential technique for coding recursive generators. Often times the most convenient algorithms for creating a sequence of results are recursive, while the most convenient interface for the consumption of those results is an iterator. PEP 380 introduced the

Re: Reducing "yield from" overhead in recursive generators

2022-03-18 Thread Rathmann
On Friday, March 18, 2022 at 2:07:45 AM UTC-7, Antoon Pardon wrote: > Op 18/03/2022 om 04:14 schreef Rathmann: > > > > So what do people think of this hack/technique? Is it > > > > A) A terrible idea? (Please be specific.) > > B) Already well-kno

Re: Reducing "yield from" overhead in recursive generators

2022-03-22 Thread Rathmann
> On 19 Mar 2022, at 03:07, Greg Ewing wrote: > > On 19/03/22 9:40 am, Rathmann wrote: >> The other challenge/question would be to see if there is a way to implement >> this basic approach with lower overhead. > > My original implementation of yield-from didn't