Closed ismailmuller closed 1 year ago
Hi @ismailmuller,
the Connection
object already implements context manager protocol, so this:
with Connetion(...) as conn:
...
already works.
Thanks for the quick response. I've not seen that in the docs but that's fine now.
Is it planned to have a contextmanager handling the connection ? This would ensure connections are closed and don't remain open.
Also this can be easily defined by the user, it'll surely helps if it's coded in the package. Best would be to modify the Connection class but I guess it's too late now to change its behavior.
example: