-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Thank you for the library!
After setting this up I found that my connection pool logic is being flagged
essentially I have:
connection_pool: asyncpg.Pool[asyncpg.Record]
def on_startup() -> None:
global connection_pool
connection_pool = await asyncpg.create_pool()
and I get an error:
Incompatible types in assignment (expression has type "Optional[Pool[Record]]", variable has type "Pool[Record]") [assignment] mypy(error)
looking at Asyncpg's pool:
I think technically it can return None
but it seems unlikely to happen for most use cases (maybe?)
so while Pool | None
represents a possible case, I think it would be okay if it didn't include it in the types for better ergonomics
What do you think?
singingwolfboy and JoseKilo
Metadata
Metadata
Assignees
Labels
No labels