From f14b63e7a34253502c31343d708ab17bd9de41d8 Mon Sep 17 00:00:00 2001 From: zhangrq02 Date: Fri, 6 Jan 2023 13:06:13 +0800 Subject: [PATCH] Add typing for arguments with default value. --- spacy/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 24f12fe65..e50ef6fd0 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -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.