[New-bugs-announce] [issue45443] 'ThreadPoolExecutor' object has no attribute 'map'
Zohim Chandani
report at bugs.python.org
Tue Oct 12 06:48:59 EDT 2021
New submission from Zohim Chandani <zohim.chandani at gmail.com>:
import concurrent.futures
import time
start = time.perf_counter()
def do_something(seconds):
print(f'sleeping for {seconds}s ... ')
time.sleep(seconds)
return f'done sleeping {seconds} '
with concurrent.futures.ThreadPoolExecutor() as executor:
secs = [5,4,3,2,1]
results = executor.map(do_something, secs)
for result in results:
print(result)
finish = time.perf_counter()
print(f'finished in {round(finish-start, 2)} seconds')
The above code yields an attribute error whereas it used to execute perfectly before. Did the method get removed?
----------
messages: 403723
nosy: zohim
priority: normal
severity: normal
status: open
title: 'ThreadPoolExecutor' object has no attribute 'map'
type: crash
versions: Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45443>
_______________________________________
More information about the New-bugs-announce
mailing list