mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Added __class_getitem__ (#4695)
Resolves #4682 Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -5,6 +5,9 @@ from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Container, Generic, Iterable, Iterator, List, Optional, Protocol, Set, Tuple, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
FIRST_COMPLETED: str
|
||||
FIRST_EXCEPTION: str
|
||||
ALL_COMPLETED: str
|
||||
@@ -54,6 +57,8 @@ class Future(Generic[_T]):
|
||||
def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ...
|
||||
def set_exception(self, exception: Any) -> None: ...
|
||||
def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class Executor:
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -7,6 +7,9 @@ if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor
|
||||
class BrokenThreadPool(BrokenExecutor): ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
_S = TypeVar("_S")
|
||||
|
||||
class ThreadPoolExecutor(Executor):
|
||||
@@ -30,3 +33,5 @@ class _WorkItem(Generic[_S]):
|
||||
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: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
Reference in New Issue
Block a user