Frozensets are immutable and not assignable
suggest changefoo = frozenset(["bar", 1, "Hello!"])
foo[2] = 7 # ERROR
foo.add(3) # ERROR
The second line raises TypeError: 'frozenset' object does not support item assignment. The third line raises AttributeError because frozenset has no add method.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents