Added some missing types from various stdlib stubs (#4466)

This commit is contained in:
Eric Traut
2020-08-29 16:45:36 -07:00
committed by GitHub
parent 3c20675813
commit bbd8c96e34
10 changed files with 73 additions and 45 deletions

View File

@@ -15,7 +15,7 @@ CPython C source: https://github.com/python/cpython/blob/master/Modules/socketmo
# Ron Murawski <ron@horizonchess.com>
# adapted for Python 2.7 by Michal Pokorny
import sys
from typing import Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Iterable, List, Optional, Sequence, Text, TextIO, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
# ----- Constants -----
@@ -713,11 +713,11 @@ class socket:
self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ...
) -> int: ...
if sys.platform == "linux" and sys.version_info >= (3, 6):
# TODO add the parameter types for sendmsg_afalg
def sendmsg_afalg(self, msg=..., *, op, iv=..., assoclen=..., flags=...) -> int: ...
def sendmsg_afalg(
self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
) -> int: ...
if sys.version_info >= (3,):
# TODO determine legal types for file parameter
def sendfile(self, file, offset: int = ..., count: Optional[int] = ...) -> int: ...
def sendfile(self, file: BinaryIO, offset: int = ..., count: Optional[int] = ...) -> int: ...
def set_inheritable(self, inheritable: bool) -> None: ...
def setblocking(self, flag: bool) -> None: ...
def settimeout(self, value: Optional[float]) -> None: ...