New submission from Zohim Chandani <zohim.chand...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue45443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to