delete_duplicates
delete_duplicates(iterable, key=None, hashable=None, cache=None):
LLM Docstring
Yield the first item associated with each distinct key.
The function uses a set by default and automatically falls back to a list when adding an unhashable key raises TypeError. A supplied cache is updated in place and can preserve uniqueness state across calls.
iterable:collections.abc.IterableValues to filter.
key:callable | NoneOptional function producing the value used for duplicate detection.
hashable:bool | NoneForce set-based or list-based storage;
Noneenables automatic fallback.cache:set | list | NoneExisting membership cache to update.
:returns:collections.abc.IteratorIterator yielding only the first value for each key.