Ram Rachum added the comment:

Looks like this a recipe in the docs is where this ticket is headed.

I took my original example for `Executor.filter` and changed it using Brian's 
suggestion so now it uses `Executor.map`. Please check it out. If someone other 
than me feels comfortable in putting it into the documentation page, I'll be 
happy if you could do that.

Possible issues:

This example uses `requests`, which isn't in the standard library.

I would say that this `for` line:

        for person in (person for person, filter_result in
                       zip(people, executor.map(has_wikipedia_page, people))
                       if filter_result):

Is a bit ugly, but since the consensus here is that this is better than 
implementing `Executor.filter`, so be it.

----------
Added file: http://bugs.python.org/file39417/filter_example.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24195>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to