Skip to main content

Command Palette

Search for a command to run...

frozen sets pay no heed to order

Updated
1 min read
frozen sets pay no heed to order

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.