typing.FrozenSet

E911259

typing.FrozenSet is a type hint in Python’s typing module that represents an immutable set of elements, typically all of the same specified type.

Jump to: Statements Referenced by

Statements (41)

Predicate Object
instanceOf Python typing construct
typing type hint
aliasOf collections.abc.Set in typing semantics
canBeNested True
cannotExpress heterogeneous element types precisely
category collection type hint
generic alias
collectionKind set-like
compatibleWith frozenset instances at runtime
definedInModule typing
elementAccessPattern membership testing only (no item assignment)
elementTypeConstraint all elements share the same annotated type
exampleUsage def f(xs: FrozenSet[int]) -> None: ...
from typing import FrozenSet
introducedInVersion Python 3.5 NERFINISHED
isDeprecatedInFavorOf types.FrozenSetType in some newer typing patterns (depending on Python version)
isGeneric True
isHashableCollection True
isImmutableCollection True
isSubscriptable True
moduleQualifiedName typing.FrozenSet
mutability immutable
parameterizedBy type variable T
pepReference PEP 484 NERFINISHED
programmingLanguage Python
relatedTo builtins.frozenset
typing.AbstractSet
typing.Set
represents collections.abc.Set subtype
immutable set type
runtimeRepresentation builtins.frozenset
supportsOperations set algebra operations (union, intersection, difference) at runtime via frozenset
supportsVariance covariant in its type parameter in many type checkers GENERATED
syntaxExample FrozenSet[Tuple[int, str]]
FrozenSet[int]
FrozenSet[str]
typeCheckerBehavior treats FrozenSet[T] as frozenset[T] at runtime
usedFor static type checking of frozenset contents
worksWith PyCharm type checker
mypy NERFINISHED
pyright

Referenced by (1)

Full triples — surface form annotated when it differs from this entity's canonical label.

PEP 484 defines typing.FrozenSet