Next / Previous / Contents / Shipman's homepage

20.17. frozenset(): Create a frozen set

This function is used to create a new frozenset value: an immutable set. General form:


This function converts an existing iterable S to a frozenset. The argument is optional; if omitted, you get a frozen empty set.

>>> frozenset()
>>> frozenset('aeiou')
frozenset(['a', 'i', 'e', 'u', 'o'])
>>> frozenset([0, 0, 0, 44, 0, 44, 18])
frozenset([0, 18, 44])

For more information, see Section 15, “Types set and frozenset: Set types”.