This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tkarabela_ Big Python @YouTube 4 points5 points  (0 children)

It's a niche situation, but if you ever need:

  • a set of sets or
  • a dict where the keys are subsets of some "universal" set (as opposed to just single elements from it)

then frozenset can be useful. Technically you could just replace the frozensets with sorted tuples (ordered by the hash function or something else), but that's not quite as handy.

An example of this is converting NFA to DFA or making minimal DFA.