Skip to main content

frozen sets pay no heed to order

Published 1 min readMarkdown
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.

About the author

  • I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae

No comments yet. Be the first to comment.