Whats new in Python 3: concurrent-futures example error?

P

Paddy

I just noted the example here:
http://docs.python.org/dev/whatsnew/3.2.html#pep-3148-the-concurrent-futures-module

import concurrent.futures, shutil
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as e:
e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
e.submit(shutil.copy, 'src3.txt', 'dest4.txt')

Should the last line show a copy of src4.txt rather than src3.txt
going to dest4.txt?

- Paddy.
 
T

Terry Reedy

I just noted the example here:
http://docs.python.org/dev/whatsnew/3.2.html#pep-3148-the-concurrent-futures-module

import concurrent.futures, shutil
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as e:
e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
e.submit(shutil.copy, 'src3.txt', 'dest4.txt')

Should the last line show a copy of src4.txt rather than src3.txt
going to dest4.txt?

I assume so. Changed in the repository.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[RELEASED] Python 3.2 rc 3 0
[RELEASED] Python 3.2.2 0
[RELEASED] Python 3.2 rc 1 0
[RELEASED] Python 3.2 11
[RELEASED] Python 3.2 rc 2 0
Python 3.2.2rc1 0

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top