+ 6
What is a frozen set in Python?
4 odpowiedzi
+ 11
"There are currently two built-in set types, set and frozenset. The set type is mutable — the contents can be changed using methods like add() and remove(). Since it is mutable, it has no hash value and cannot be used as either a dictionary key or as an element of another set. The frozenset type is immutable and hashable — its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set."
+ 8
frozenset is an immutable set
similar to:
tuple is an immutable list
The frozenset cannot be changed after its creation, but acts like a set, you can do intersect, set difference etc. operations on it, but can't slice it like a list or tuple. You can use frozenset as dictionary key, because it is hashable (unlike a set).
https://stackoverflow.com/questions/14422409/difference-between-tuples-and-frozensets-in-JUMP_LINK__&&__python__&&__JUMP_LINK
+ 3
Is this what you search for?
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/ref_func_frozenset.asp
+ 2