Fix missing argument types in py3 stdlib (#995)

Still missing a few in _subprocess (a Windows-only private module) and decimal
(I gave up).
This commit is contained in:
Jelle Zijlstra
2017-03-14 11:43:42 -07:00
committed by Guido van Rossum
parent 01b3915b3f
commit 11350ed8cc
6 changed files with 16 additions and 14 deletions

View File

@@ -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: ...

View File

@@ -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.