socket: timeout may be None (#2801)

timeout=None puts the socket into blocking mode.

Read <https://bugs.python.org/issue18417> and the referenced other
issues for more gory details.
This commit is contained in:
Philipp Hahn
2019-02-18 11:32:25 +01:00
committed by Sebastian Rittau
parent 570fd6aff1
commit b022f76516

View File

@@ -537,7 +537,7 @@ class socket:
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
def gettimeout(self) -> float: ...
def gettimeout(self) -> Optional[float]: ...
def ioctl(self, control: object,
option: Tuple[int, int, int]) -> None: ...
if sys.version_info < (3, 5):
@@ -579,7 +579,7 @@ class socket:
# ----- functions -----
def create_connection(address: Tuple[Optional[str], int],
timeout: float = ...,
timeout: Optional[float] = ...,
source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ...
# the 5th tuple item is an address