Closed
Description
Following suggestion in mypy #3564.
Repro:
import multiprocessing
import os
METHODS = ['spawn', 'fork', 'forkserver']
if __name__ == '__main__':
for method in METHODS:
context = multiprocessing.get_context(method)
with context.Pool(processes=4) as pool:
results = [pool.apply_async(os.getpid, ()) for i in range(4)]
print([res.get(timeout=1) for res in results], method)
mypy with --check-untyped-defs
or with --disallow-untyped-defs
complains with the single message ...:8:18:error: Module has no attribute "get_context"
.
Metadata
Metadata
Assignees
Labels
No labels