Author zohim
Recipients zohim
Date 2021-10-12.10:48:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634035739.42.0.184025452389.issue45443@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-10-12 10:48:59zohimsetrecipients: + zohim
2021-10-12 10:48:59zohimsetmessageid: <1634035739.42.0.184025452389.issue45443@roundup.psfhosted.org>
2021-10-12 10:48:59zohimlinkissue45443 messages
2021-10-12 10:48:59zohimcreate