dingykhan1 / scoop

Automatically exported from code.google.com/p/scoop
GNU Lesser General Public License v3.0
0 stars 0 forks source link

kwargs are not accepted in submit call anymore #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
My program used to pass kwargs argument to the function using futures.submit  
when I was using version 0.6.2. When I upgrade to 0.7.2 this possibility was no 
longer there. I checked the source code and noticed that most functions stopped 
processing kwargs argument. 

Since my program relied heavily on this feature I re-enabled kwargs support in 
futures , see attached patch. 

Original issue reported on code.google.com by v.s.fo...@ilmarin.info on 4 Jun 2014 at 5:31

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for your feedback.

The logic behind the removal was the ambiguity that it raises while using the 
map() function. In fact, **kwargs was never there in the first place in the 
futures standard ( PEP-3148: http://legacy.python.org/dev/peps/pep-3148/ ). If 
you need such a functionality for the map() function, we agreed that applying a 
partial to it would be the most explicit way to do it (see 
https://docs.python.org/3/library/functools.html#functools.partial ).

I was a little hasty and erroneously removed it also in the submit() function. 
I agree with you, the submit() should have kept the **kwargs in its signature. 
The map() kept the **kwargs because of the timeout argument which can be passed 
to it. The problem has been fixed in a recent commit ( 
https://code.google.com/p/scoop/source/detail?r=599e88069ebd2bb169795648f6599a6c
1dbc55da ).

Let me know if it fixed your problem.

Original comment by yannickh...@gmail.com on 15 Jul 2014 at 5:04

GoogleCodeExporter commented 8 years ago
Hello,

yes, seem to work with your patch fine. 

Original comment by v.s.fo...@ilmarin.info on 15 Jul 2014 at 5:24