Skip to content

Commit 8dd1a76

Browse files
committed
Add type annotations to _parse_hostlist
1 parent 82dd273 commit 8dd1a76

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

asyncpg/connect_utils.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,20 @@ def _validate_port_spec(
182182
return port
183183

184184

185-
def _parse_hostlist(hostlist, port, *, unquote=False):
185+
def _parse_hostlist(
186+
hostlist: str,
187+
port: typing.Union[int, typing.List[int]],
188+
*,
189+
unquote: bool = False,
190+
) -> typing.Tuple[typing.List[str], typing.List[int]]:
186191
if ',' in hostlist:
187192
# A comma-separated list of host addresses.
188193
hostspecs = hostlist.split(',')
189194
else:
190195
hostspecs = [hostlist]
191196

192-
hosts = []
193-
hostlist_ports = []
197+
hosts: typing.List[str] = []
198+
hostlist_ports: typing.List[int] = []
194199

195200
if not port:
196201
portspec = os.environ.get('PGPORT')

0 commit comments

Comments
 (0)