-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
👋 Filing this as I noticed the stub for map_async was returning too many depths of nested lists.
Here's a simple script to reproduce:
from multiprocessing.pool import Pool
from typing import List
def double(x: int) -> int:
return 2 * x
def parallel_double(xx: List[int]) -> List[int]:
with Pool(len(xx)) as pool:
return pool.map_async(double, xx).get()
print(parallel_double([1, 2]))To sanity check that the type annotations as written are correct:
$ python3 map_async.py
[2, 4]
And here's the output of mypy:
$ mypy map_async.py
map_async.py:9: error: Incompatible return value type (got "List[List[int]]", expected "List[int]")
Found 1 error in 1 file (checked 1 source file)
I'm going to see if I can get a contribution environment up and running quickly and submit a PR to fix.
Edit: typo
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels