[Python-ideas] Add `Executor.filter`

Ram Rachum ram at rachum.com
Thu May 7 08:02:25 CEST 2015


Funny, I suggested these 2 in the past:
https://groups.google.com/forum/m/#!searchin/python-ideas/map_as_completed/python-ideas/
<https://groups.google.com/forum/m/#!searchin/python-ideas/map_as_completed/python-ideas/VZBdUbYcQjg>
VZBdUbYcQjg
<https://groups.google.com/forum/m/#!searchin/python-ideas/map_as_completed/python-ideas/VZBdUbYcQjg>

https://groups.google.com/forum/m/#!searchin/python-ideas/as_completed/python-ideas/yGADxChihhk

Sent from my phone.
On 2 May 2015 at 19:25, Ram Rachum <ram at rachum.com> wrote:
> Okay, I implemented it. Might be getting something wrong because I've
never
> worked with the internals of this module before.

I think this is sufficiently tricky to get right that it's worth
adding filter() as a parallel to the existing map() API.

However, it did raise a separate question for me: is it currently
possible to use Executor.map() and the as_completed() module level
function together? Unless I'm missing something, it doesn't look like
it, as map() hides the futures from the caller, so you only have
something to pass to as_completed() if you invoke submit() directly.

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150507/9f57b398/attachment-0001.html>


More information about the Python-ideas mailing list