-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup aiopg.pool.Pool.cursor method #264
Comments
I've added a sample impl here: #265 |
I just ran into this. The documented usage is: https://aiopg.readthedocs.io/en/stable/core.html#aiopg.Pool.cursor When I try this in Python 3.8.4, it does fail since
The cleanest spelling seems to be:
At the very least, we should update the documentation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
right now using this method is not async with nice, with the syntax:
Based on the usage of context managers in aiopg, it should instead behavior like aiopg.create_pool, to yield the following usage:
In order to accomplish this aiopg.pool.Pool.cursor should not be marked a coroutine, and the acquisition of the connection and cursor should not happen until
__aenter__
of _PoolCursorContextManager. With the current design probably the easiest way would be to pass a coroutine closure to _PoolCursorContextManager to return the conn and cur during__aenter__
The text was updated successfully, but these errors were encountered: