Use _typeshed.Self with __enter__ (#5719)

This commit is contained in:
Anton Grübel
2021-07-01 23:15:13 +02:00
committed by GitHub
parent 96e0660fba
commit 8a107464a8
11 changed files with 30 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
import sys
import threading
from _typeshed import Self
from abc import abstractmethod
from logging import Logger
from typing import (
@@ -79,7 +80,7 @@ class Executor:
def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ...
else:
def shutdown(self, wait: bool = ...) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ...
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...