I need set-like data structure with these properties:
- hashable
- no duplicate elements
- maintains order
- immutable
- iterable
- part of standard library? want to keep it simple
What is happening:
frozenset([3,1,2,2,3]) -> frozenset(1,2,3)
What I need:
frozenset*([3,1,2,2,3]) -> frozenset*(3,1,2)
I thought I could use frozenset but both sets and frozensets reorder elements. I assume this is for faster duplicate checks? But in any case I can't have a reordering.
def no_dupe(data): return tuple(dict.fromkeys(data))