mirror of https://github.com/explosion/spaCy.git
Add typing for arguments with default value.
This commit is contained in:
parent
154bbea709
commit
f14b63e7a3
|
@ -1739,7 +1739,7 @@ def all_equal(iterable):
|
||||||
return next(g, True) and not next(g, False)
|
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.
|
"""Check if 'host:port' is in use. Return True if it is, False otherwise.
|
||||||
|
|
||||||
Keyword arguments:
|
Keyword arguments:
|
||||||
|
@ -1756,7 +1756,7 @@ def _is_port_in_use(port: int, host="localhost") -> bool:
|
||||||
s.close()
|
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.
|
"""Given a starting port and a host, handle finding a port.
|
||||||
|
|
||||||
If `auto_select` is False, a busy port will raise an error.
|
If `auto_select` is False, a busy port will raise an error.
|
||||||
|
|
Loading…
Reference in New Issue