Returns the first item in the list for which function(item) is True, None otherwise.
(function, iterable)
| 111 | return [x for x in iterable if x not in seen and not seen.add(x)] |
| 112 | |
| 113 | def find(function, iterable): |
| 114 | """ Returns the first item in the list for which function(item) is True, None otherwise. |
| 115 | """ |
| 116 | for x in iterable: |
| 117 | if function(x) is True: |
| 118 | return x |
| 119 | |
| 120 | def combinations(iterable, n): |
| 121 | # Backwards compatibility. |