def unique(iterable):
    """Yields unique elements from iterable, preserving order."""
    seen = set()
    seen_add = seen.add
    for element in iterable:
        if element in seen:
            continue
        seen_add(element)
        yield element
