File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ class PoolAcquireContext(Generic[_Record]):
519
519
) -> Generator [Any , None , PoolConnectionProxy [_Record ]]: ...
520
520
521
521
@overload
522
- async def create_pool (
522
+ def create_pool (
523
523
dsn : str | None = ...,
524
524
* ,
525
525
min_size : int = ...,
@@ -546,7 +546,7 @@ async def create_pool(
546
546
server_settings : dict [str , str ] | None = ...,
547
547
) -> Pool [protocol .Record ]: ...
548
548
@overload
549
- async def create_pool (
549
+ def create_pool (
550
550
dsn : str | None = ...,
551
551
* ,
552
552
min_size : int = ...,
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ incremental = true
57
57
strict = true
58
58
59
59
[tool .pyright ]
60
- include = [" asyncpg-stubs" ]
60
+ include = [" asyncpg-stubs" , " tests " ]
61
61
62
62
pythonVersion = " 3.7"
63
63
reportUnnecessaryTypeIgnoreComment = " warning"
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ from typing_extensions import assert_type
4
+
5
+ import asyncpg
6
+
7
+
8
+ async def main () -> None :
9
+ pool = await asyncpg .create_pool ()
10
+ assert_type (pool , 'asyncpg.Pool[asyncpg.Record] | None' )
11
+ assert pool is not None
12
+ assert_type (await pool , 'asyncpg.Pool[asyncpg.Record] | None' )
13
+
14
+ async with asyncpg .create_pool () as pool :
15
+ assert_type (pool , asyncpg .Pool [asyncpg .Record ])
You can’t perform that action at this time.
0 commit comments