[issue41577] Cannot use ProcessPoolExecutor if in a decorator?

2020-08-18 Thread Kyle Stanley
Kyle Stanley added the comment: Due to the way pickle works, it's not presently possible to serialize wrapped functions directly, at least not in a way that allows you to pass it to executor.submit() within the inner function (AFAICT). I'm also not certain what it would involve to provide

[issue41577] Cannot use ProcessPoolExecutor if in a decorator?

2020-08-18 Thread Bob Fang
Change by Bob Fang : -- versions: +Python 3.6, Python 3.7, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41577] Cannot use ProcessPoolExecutor if in a decorator?

2020-08-18 Thread Bob Fang
New submission from Bob Fang : I have this minimal example: ``` from functools import wraps from concurrent import futures import random def decorator(func): num_process = 4 def impl(*args, **kwargs): with futures.ProcessPoolExecutor() as executor: fs = []