You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes have a third-party function or method that I would like to retry using backoff. Currently, I have to wrap the call in a single line function and decorate that. It would be nice if I could, instead, use a context manager.
This has come up before and there is some ongoing discussion here #18
And you are correct that this can't be done as originally suggested. We've talked about a few variants of this idea but I've never quite been able to make it work in a way that is a clear improvement to the status quo. FWIW, in the case where you are calling that 3rd party function in a single place, I recommend the decorating the function inline (as you do in your example above) as a best practice.
I sometimes have a third-party function or method that I would like to retry using backoff. Currently, I have to wrap the call in a single line function and decorate that. It would be nice if I could, instead, use a context manager.
So what I currently do is:
And what I'd like to be able to do:
The text was updated successfully, but these errors were encountered: