Julien Danjou
Julien Danjou
Not sure this fixes/help with anything though?
Yes, I think having a context manager would be an interesting feature. :)
So there's actually no interesting thing we can do with the `with` statement in Python. It'd be useful if there was some macro, but, nop. Basically your example turns down...
@proppy sounds like a good idea. It's not much different than doing `retrying(foo, 3)` but I can see the value of being more Pythonic. Wanna do a PR? ;)
@heri16 There's no need for a context manager in this case… you can just do `func_result = tenacity.Retrying()(func, args)`…
I took a look at your idea @proppy but unfortunately, there's no way to re-call the function in `__exit__` since the code/function that is being called in the `with` statement...
That looks like cutting the workflow in piece but I can see some value. If you can make it, go ahead.
I don't think it's a lot of refactoring nowadays. You could probably add an `__iter__` method on `tenacity.Retrying` whose code would be based on the `tenacity.Retrying.call` method. The latter uses...
@Brian-Williams That sounds like a good idea. Feel free to send a PR.
Ah I think CI is broken again. Really need to move to GH Actions.