Files
2026-08-24 08:11:59 -07:00

11 lines
318 B
Python

from collections.abc import Callable, Iterable
from typing import Any
def stable_unique(values: Iterable[Any], key: Callable[[Any], Any]) -> list[Any]:
result = []
for value in values:
if not any(key(existing) == key(value) for existing in result):
result.append(value)
return result