Matthew McEwen

Results 6 comments of Matthew McEwen

@WoLpH Thanks for pointing out the context manager solution, In my case, I'm handing around a lot of iterators and I'd like to selectively wrap some in progress bars, so...

> I fail to see how, but I might be missing something here :) For clarity, all I meant by the iterator cleaning up after itself was exactly that it...

> I can catch `GeneratorExit` Ah, that's perfect Again, happy to make the PR, otherwise, thanks very much for your help!

This doesn't work, but it took me a while to work out why. Apologies for going into this pedagogically, I wrote most of this while I was working out for...

I realized that we could do a less invasive job by promoting the ProgressBar itself to being a Generator. This is a much smaller change, as a Generator is just...

The above (and the shortcut) both do something similar but not identical to the solution in the PR. When python runs the generator function, it returns a new generator object...