diff --git a/stdlib/multiprocessing/pool.pyi b/stdlib/multiprocessing/pool.pyi index 2e52981a5..518e4b736 100644 --- a/stdlib/multiprocessing/pool.pyi +++ b/stdlib/multiprocessing/pool.pyi @@ -2,10 +2,13 @@ import sys from _typeshed import Self from contextlib import AbstractContextManager from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, TypeVar +from typing_extensions import Literal if sys.version_info >= (3, 9): from types import GenericAlias +__all__ = ["Pool", "ThreadPool"] + _PT = TypeVar("_PT", bound=Pool) _S = TypeVar("_S") _T = TypeVar("_T") @@ -115,11 +118,11 @@ class ThreadPool(Pool, AbstractContextManager[ThreadPool]): # undocumented if sys.version_info >= (3, 8): - INIT: str - RUN: str - CLOSE: str - TERMINATE: str + INIT: Literal["INIT"] + RUN: Literal["RUN"] + CLOSE: Literal["CLOSE"] + TERMINATE: Literal["TERMINATE"] else: - RUN: int - CLOSE: int - TERMINATE: int + RUN: Literal[0] + CLOSE: Literal[1] + TERMINATE: Literal[2]