[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-13 Thread Zohim Chandani


Zohim Chandani  added the comment:

Please see attached. I have printed out the python version. Running this on VS 
code.

--
Added file: https://bugs.python.org/file50353/Screenshot 2021-10-13 at 
12.45.04.png

___
Python tracker 
<https://bugs.python.org/issue45443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-12 Thread Zohim Chandani


New submission from Zohim Chandani :

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 
<https://bugs.python.org/issue45443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com