diff --git a/stdlib/2and3/fractions.pyi b/stdlib/2and3/fractions.pyi index 66408fbff..90771a63a 100644 --- a/stdlib/2and3/fractions.pyi +++ b/stdlib/2and3/fractions.pyi @@ -30,11 +30,11 @@ class Fraction(Rational): *, _normalize: bool = True) -> None: ... @overload - def __init__(self, value: float, *, _normalize=True) -> None: ... + def __init__(self, value: float, *, _normalize: bool = True) -> None: ... @overload - def __init__(self, value: Decimal, *, _normalize=True) -> None: ... + def __init__(self, value: Decimal, *, _normalize: bool = True) -> None: ... @overload - def __init__(self, value: str, *, _normalize=True) -> None: ... + def __init__(self, value: str, *, _normalize: bool = True) -> None: ... @classmethod def from_float(cls, f: float) -> 'Fraction': ... diff --git a/stdlib/3.4/asyncio/locks.pyi b/stdlib/3.4/asyncio/locks.pyi index d80ddc424..559effd98 100644 --- a/stdlib/3.4/asyncio/locks.pyi +++ b/stdlib/3.4/asyncio/locks.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Generator, Iterable, Iterator, TypeVar, Union +from typing import Any, Callable, Generator, Iterable, Iterator, TypeVar, Union, Optional from .coroutines import coroutine from .events import AbstractEventLoop @@ -49,11 +49,11 @@ class Condition(_ContextManagerMixin): def notify_all(self) -> None: ... class Semaphore(_ContextManagerMixin): - def __init__(self, value: int = 1, *, loop: AbstractEventLoop = None) -> None: ... + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... def locked(self) -> bool: ... @coroutine def acquire(self) -> Generator[Any, None, bool]: ... def release(self) -> None: ... class BoundedSemaphore(Semaphore): - def __init__(self, value=1, *, loop: AbstractEventLoop = None) -> None: ... + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... diff --git a/stdlib/3.4/asyncio/tasks.pyi b/stdlib/3.4/asyncio/tasks.pyi index e95d758ae..bf69df8ea 100644 --- a/stdlib/3.4/asyncio/tasks.pyi +++ b/stdlib/3.4/asyncio/tasks.pyi @@ -15,7 +15,7 @@ FIRST_COMPLETED = 'FIRST_COMPLETED' ALL_COMPLETED = 'ALL_COMPLETED' def as_completed(fs: Sequence[_FutureT[_T]], *, loop: AbstractEventLoop = ..., - timeout=None) -> Iterator[Generator[Any, None, _T]]: ... + timeout: Optional[float] = ...) -> Iterator[Generator[Any, None, _T]]: ... def ensure_future(coro_or_future: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ... # TODO: gather() should use variadic type vars instead of _TAny. diff --git a/stdlib/3/_posixsubprocess.pyi b/stdlib/3/_posixsubprocess.pyi index a048a10c8..67b7d7cc5 100644 --- a/stdlib/3/_posixsubprocess.pyi +++ b/stdlib/3/_posixsubprocess.pyi @@ -2,12 +2,13 @@ # NOTE: These are incomplete! -from typing import Tuple, Sequence +from typing import Tuple, Sequence, Callable def cloexec_pipe() -> Tuple[int, int]: ... def fork_exec(args: Sequence[str], - executable_list, close_fds, fds_to_keep, cwd: str, env_list, + executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int], + cwd: str, env_list: Sequence[bytes], p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int, errread: int, errwrite: int, errpipe_read: int, - errpipe_write: int, restore_signals, start_new_session, - preexec_fn) -> int: ... + errpipe_write: int, restore_signals: int, start_new_session: int, + preexec_fn: Callable[[], None]) -> int: ... diff --git a/stdlib/3/http/client.pyi b/stdlib/3/http/client.pyi index e59497160..340f09033 100644 --- a/stdlib/3/http/client.pyi +++ b/stdlib/3/http/client.pyi @@ -7,6 +7,7 @@ from typing import ( ) import email.message import io +from socket import socket import sys import ssl import types @@ -87,7 +88,7 @@ if sys.version_info >= (3, 5): closed = ... # type: bool status = ... # type: int reason = ... # type: str - def __init__(self, sock, debuglevel: int = ..., + def __init__(self, sock: socket, debuglevel: int = ..., method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... def read(self, amt: Optional[int] = ...) -> bytes: ... def readinto(self, b: bytearray) -> int: ... diff --git a/stdlib/3/shlex.pyi b/stdlib/3/shlex.pyi index db99fc668..ed23d5aa3 100644 --- a/stdlib/3/shlex.pyi +++ b/stdlib/3/shlex.pyi @@ -2,7 +2,7 @@ # Based on http://docs.python.org/3.2/library/shlex.html -from typing import List, Tuple, Any, TextIO +from typing import List, Tuple, Any, TextIO, Union, Optional def split(s: str, comments: bool = ..., posix: bool = ...) -> List[str]: ... @@ -26,7 +26,7 @@ class shlex: token = ... # type: str eof = ... # type: str - def __init__(self, instream=..., infile=..., + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., posix: bool = ...) -> None: ... def get_token(self) -> str: ... def push_token(self, tok: str) -> None: ...