stdlib/selectors: change timeout argument type to float (#2070)

The Selector's code internally uses select.select and passes the
timeout argument to it. The documentation explicitly states the
timeout is a floating point number:
https://docs.python.org/3/library/select.html?highlight=select#select.select
This commit is contained in:
Tomas Krizek
2018-04-19 17:36:53 +02:00
committed by Jelle Zijlstra
parent 2935017157
commit db5137b756

View File

@@ -37,7 +37,7 @@ class BaseSelector(metaclass=ABCMeta):
def modify(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
@abstractmethod
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def close(self) -> None: ...
@@ -53,38 +53,38 @@ class BaseSelector(metaclass=ABCMeta):
class SelectSelector(BaseSelector):
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...
class PollSelector(BaseSelector):
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...
class EpollSelector(BaseSelector):
def fileno(self) -> int: ...
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...
class DevpollSelector(BaseSelector):
def fileno(self) -> int: ...
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...
class KqueueSelector(BaseSelector):
def fileno(self) -> int: ...
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...
class DefaultSelector(BaseSelector):
def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ...
def unregister(self, fileobj: _FileObject) -> SelectorKey: ...
def select(self, timeout: Optional[int] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[_FileObject, SelectorKey]: ...