Add typing for arguments with default value.

This commit is contained in:
zhangrq02 2023-01-06 13:06:13 +08:00
parent 154bbea709
commit f14b63e7a3
No known key found for this signature in database
GPG Key ID: 03E6FF68E3E855D1
1 changed files with 2 additions and 2 deletions

View File

@ -1739,7 +1739,7 @@ def all_equal(iterable):
return next(g, True) and not next(g, False)
def _is_port_in_use(port: int, host="localhost") -> bool:
def _is_port_in_use(port: int, host: str = "localhost") -> bool:
"""Check if 'host:port' is in use. Return True if it is, False otherwise.
Keyword arguments:
@ -1756,7 +1756,7 @@ def _is_port_in_use(port: int, host="localhost") -> bool:
s.close()
def find_available_port(start: int, host: str, auto_select=False) -> int:
def find_available_port(start: int, host: str, auto_select: bool = False) -> int:
"""Given a starting port and a host, handle finding a port.
If `auto_select` is False, a busy port will raise an error.