Re: Reducing "yield from" overhead in recursive generators

2022-03-18 Thread Chris Angelico
On Sat, 19 Mar 2022 at 14:06, 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 have this problem, > because it

Re: Reducing "yield from" overhead in recursive generators

2022-03-18 Thread Greg Ewing
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 have this problem, because it didn't enter any of the intermediate frames -- it just ran down

Compiling and Linking pre-built Windows Python libraries with C++ files on Linux for Windows

2022-03-18 Thread Ankit Agarwal
Hi, This is a very specific question. I am trying to figure out whether or not I can use pre-built python libraries and headers on Windows in a MinGW build on Linux. Essentially I have some python and C++ code which interface via cython and pybind. I want to build a self contained C++ binary for W

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-known (and I just missed it.) > > C) Potentially

Re: Reducing "yield from" overhead in recursive generators

2022-03-18 Thread Antoon Pardon
Op 18/03/2022 om 04:14 schreef Rathmann: ... ```python def recursive_generator_driver(g): """g is a generator object, which is likely to call other generators""" stack = [g] while True: g = stack[-1] try: val = next(g) if isinstance(val,