Few more fixes for issues found by testing on internal codebases (#4876)

Few unrelated (but quite obvious) fixes here.

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
Ivan Levkivskyi
2020-12-30 17:32:14 +00:00
committed by GitHub
parent 85d6df4742
commit 4141dd1176
4 changed files with 6 additions and 6 deletions

View File

@@ -85,13 +85,13 @@ class Executor:
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976
class DoneAndNotDoneFutures(Sequence[_T]):
class DoneAndNotDoneFutures(Sequence[Set[Future[_T]]]):
done: Set[Future[_T]]
not_done: Set[Future[_T]]
def __new__(_cls, done: Set[Future[_T]], not_done: Set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, i: int) -> _T: ...
def __getitem__(self, i: int) -> Set[Future[_T]]: ...
@overload
def __getitem__(self, s: slice) -> DoneAndNotDoneFutures[_T]: ...