mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-22 18:01:07 +00:00
7 lines
191 B
Python
7 lines
191 B
Python
from typing import Sequence, Any, Callable
|
|
|
|
|
|
def first(sequence: Sequence[Any], predicate: Callable[[Any], bool]) -> Any:
|
|
matching = filter(predicate, sequence)
|
|
return next(matching)
|