mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
fix: Add MapResult type (#3228)
This commit is contained in:
@@ -17,6 +17,8 @@ class ApplyResult(Generic[_T]):
|
||||
# alias created during issue #17805
|
||||
AsyncResult = ApplyResult
|
||||
|
||||
class MapResult(ApplyResult[List[_T]]): ...
|
||||
|
||||
_IMIT = TypeVar('_IMIT', bound=IMapIterator)
|
||||
|
||||
class IMapIterator(Iterator[_T]):
|
||||
@@ -50,7 +52,7 @@ class Pool(ContextManager[Pool]):
|
||||
iterable: Iterable[_S] = ...,
|
||||
chunksize: Optional[int] = ...,
|
||||
callback: Optional[Callable[[_T], None]] = ...,
|
||||
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ...
|
||||
error_callback: Optional[Callable[[BaseException], None]] = ...) -> MapResult[List[_T]]: ...
|
||||
def imap(self,
|
||||
func: Callable[[_S], _T],
|
||||
iterable: Iterable[_S] = ...,
|
||||
|
||||
Reference in New Issue
Block a user