Get the first occurrence in two lists. Args: list1: List to iterate list2: List to check against
(list1: list[str], list2: list[str])
| 4 | |
| 5 | |
| 6 | def find_item_match(list1: list[str], list2: list[str]) -> str | None: |
| 7 | """ |
| 8 | Get the first occurrence in two lists. |
| 9 | |
| 10 | Args: |
| 11 | list1: List to iterate |
| 12 | list2: List to check against |
| 13 | """ |
| 14 | set_to_check = set(list2) |
| 15 | return next((i for i in list1 if i in set_to_check), None) |
| 16 | |
| 17 | |
| 18 | def first_exclude(list_: list[str], exclude: str) -> str | None: |
no outgoing calls
no test coverage detected