frozen sets pay no heed to order

ยท

1 min read

I superficially assumed a frozenset accounts for the order of items it was constructed with such that the following assertion would fail.

assert(
   frozenset([('a',1), ('b',1)]) == frozenset([('b',1), ('a',1)])
)

Thinking about it for a second, sets are unordered, hence the above assertion holds.

ย