Enable --disallow-any-generics for stubs (#3288)

This commit is contained in:
Sebastian Rittau
2019-10-01 14:31:34 +02:00
committed by Jelle Zijlstra
parent 23b353303b
commit c32e1e2280
77 changed files with 386 additions and 329 deletions

View File

@@ -62,25 +62,25 @@ def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when:
class _Waiter:
event: threading.Event
finished_futures: List[Future]
finished_futures: List[Future[Any]]
def __init__(self) -> None: ...
def add_result(self, future: Future) -> None: ...
def add_exception(self, future: Future) -> None: ...
def add_cancelled(self, future: Future) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AsCompletedWaiter(_Waiter):
lock: threading.Lock
def __init__(self) -> None: ...
def add_result(self, future: Future) -> None: ...
def add_exception(self, future: Future) -> None: ...
def add_cancelled(self, future: Future) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _FirstCompletedWaiter(_Waiter):
def add_result(self, future: Future) -> None: ...
def add_exception(self, future: Future) -> None: ...
def add_cancelled(self, future: Future) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AllCompletedWaiter(_Waiter):
@@ -88,13 +88,13 @@ class _AllCompletedWaiter(_Waiter):
stop_on_exception: bool
lock: threading.Lock
def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ...
def add_result(self, future: Future) -> None: ...
def add_exception(self, future: Future) -> None: ...
def add_cancelled(self, future: Future) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AcquireFutures:
futures: Iterable[Future]
def __init__(self, futures: Iterable[Future]) -> None: ...
futures: Iterable[Future[Any]]
def __init__(self, futures: Iterable[Future[Any]]) -> None: ...
def __enter__(self) -> None: ...
def __exit__(self, *args: Any) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Optional, Tuple, TypeVar, Generic
from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic
from ._base import Executor, Future
import sys
@@ -22,10 +22,9 @@ class ThreadPoolExecutor(Executor):
class _WorkItem(Generic[_S]):
future: Future
fn: Callable[[Future[_S]], Any]
args: Any
kwargs: Any
def __init__(self, future: Future, fn: Callable[[Future[_S]], Any], args: Any,
kwargs: Any) -> None: ...
future: Future[_S]
fn: Callable[..., _S]
args: Iterable[Any]
kwargs: Mapping[str, Any]
def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
def run(self) -> None: ...