Collection Interface ABCs

collections.abc.Set

Set-like collections with membership, iteration and length, providing mathematical set mixins to direct subclasses.

Formal Syntax & Structure

python syntaxpython
collections.abc.Set

Return Value

type

Abstract base class object representing the described interface; use it for recognition or inheritance.

Working Example

Example Snippetpython
import collections.abcprint(isinstance(frozenset({1,2}),collections.abc.Set))
Python Reference