From 0aa9060e6657565cd1ecf8c0b7551d8a115a3f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sun, 24 May 2020 03:11:19 +0700 Subject: [PATCH] Remove context manager hints in multiprocessing.pool in Python 2 (#4060) --- stdlib/2/multiprocessing/pool.pyi | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/stdlib/2/multiprocessing/pool.pyi b/stdlib/2/multiprocessing/pool.pyi index 4001a5a2b..014efd452 100644 --- a/stdlib/2/multiprocessing/pool.pyi +++ b/stdlib/2/multiprocessing/pool.pyi @@ -1,7 +1,4 @@ -from typing import ( - Any, Callable, ContextManager, Iterable, Optional, Dict, List, - TypeVar, Iterator, -) +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TypeVar _T = TypeVar('_T', bound=Pool) @@ -17,7 +14,7 @@ class IMapIterator(Iterator[Any]): class IMapUnorderedIterator(IMapIterator): ... -class Pool(ContextManager[Pool]): +class Pool(object): def __init__(self, processes: Optional[int] = ..., initializer: Optional[Callable[..., None]] = ..., initargs: Iterable[Any] = ..., @@ -50,10 +47,8 @@ class Pool(ContextManager[Pool]): def close(self) -> None: ... def terminate(self) -> None: ... def join(self) -> None: ... - def __enter__(self: _T) -> _T: ... - -class ThreadPool(Pool, ContextManager[ThreadPool]): +class ThreadPool(Pool): def __init__(self, processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ...) -> None: ...