FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add type hint to entering PoolAcquireContext. by robhaswell · Pull Request #763 · MagicStack/asyncpg · GitHub

Add type hint to entering PoolAcquireContext. - #763

Closed
robhaswell wants to merge 2 commits into
MagicStack:masterfrom
robhaswell:pool-connection-types
Closed

Add type hint to entering PoolAcquireContext.#763
robhaswell wants to merge 2 commits into
MagicStack:masterfrom
robhaswell:pool-connection-types

Conversation

Copy link
Copy Markdown

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 changed the title Allow type checkers to determine that entering a PoolAcquireContext returns a Connection Add type hint to entering PoolAcquireContext. May 26, 2021

Copy link
Copy Markdown

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 😂

DanielNoord commented Oct 29, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

See my explanation in #578 (comment).

This would actually be incorrect and I have proposed an improved patch in that PR.

I'd suggest closing this PR to not have two PRs open with the same intent.

Copy link
Copy Markdown
Author

Thanks will do.

robhaswell closed this Oct 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL