On this page
  1. frozenset
  2. Import & Availability
  3. Overview & Signature
  4. Common Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

frozenset

Prev: format | Up: __builtins__ | Next: getattr
Rel: bool, int, float, complex, str
Ref: docs.python.org — frozenset
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import frozenset

Overview & Signature

frozenset(iterable=(), /)

Build an immutable unordered collection of unique elements.

Common Methods & Attributes

Usage

fs = frozenset(["read", "write"])
assert "read" in fs and len({fs: "allowed"}) == 1

Gotchas

REPL Inspect

help(frozenset)

Linked from

Related notes