dedupe(iterable, get_key)[source]ΒΆ

Yield from iterable without duplicates.

Parameters:
  • iterable (iterable) – The iterable whose items should be deduped.
  • get_key (callable) – Takes an item from iterable and a key. If two items return the same key, they are considered duplicates.
Yields:

object – An item in iterable.