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 have a script written in a procedural style, and I want to reuse a context manager for different functions without recreating it. Specifically, I want to manage the lifecycle of MyClient (a subclass of httpx.Client) using a context manager.
I have a script written in a procedural style, and I want to reuse a context manager for different functions without recreating it. Specifically, I want to manage the lifecycle of
MyClient
(a subclass ofhttpx.Client
) using a context manager.Here's an example of my current setup:
I want to be able to close MyClient using a context manager. How can I achieve this?
I've tried to keep it short, please let me know if I need to provide more details.
The text was updated successfully, but these errors were encountered: