Skip to content
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

Add type hint to entering PoolAcquireContext. #763

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robhaswell
Copy link

This branch allows type checking editors like VScode to determine that async with pg.acquire() as conn results in conn having a type of asyncpg.connection.Connection.

@robhaswell robhaswell changed the title Allow type checkers to determine that entering a PoolAcquireContext returns a Connection Add type hint to entering PoolAcquireContext. May 26, 2021
@MarsBatya
Copy link

i face the same issue today in 2022. and for whatever reason "-> connection.Connection:" doesn't seem to be working. But if i actually "from .connection import Connection" and make it "-> Connection:", everything works great. I don't feel like a very experienced pullrequester, can someone please check what's wrong 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants