General Set API =============== From the `Python documentation `__. +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Class | Inherits from | Abstract methods | Mixin methods | +==========================================================+==============================================+===================================================================+================================================================================================================================================================================================================================================================================================================================+ | :class:`collections.abc.Set` | :class:`collections.abc.Collection` | ``__contains__``, ``__iter__``, ``__len__`` | ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint`` | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`collections.abc.MutableSet` | :class:`collections.abc.Set` | ``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard`` | Inherited ``Set`` methods and ``clear``, ``pop``, ``remove``, ``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__`` | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`set` | --- | | :class:`collections.abc.MutableSet` methods and ``__rand__``, ``__ror__``, ``__rsub__``, ``__rxor__``, ``copy``, ``difference``, ``difference_update``, ``discard``, ``intersection``, ``intersection_update``, ``issubset``, ``issuperset``, ``symmetric_difference``, ``symmetric_difference_update``, ``union``, ``update`` | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`frozenset` | --- | | :class:`collections.abc.Set` methods and ``__rand__``, ``__ror__``, ``__rsub__``, ``__rxor__``, ``copy``, ``difference``, ``intersection``, ``symmetric_difference``, ``union`` | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`typing.AbstractSet` (deprecated since 3.9) | equal to :class:`collections.abc.Set` | | | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`typing.Set` (deprecated since 3.9) | equal to :class:`set` | | | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`typing.MutableSet` (deprecated since 3.9) | equal to :class:`collections.abc.MutableSet` | | | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :class:`typing.FrozenSet` (deprecated since 3.9) | equal to :class:`frozenset` | | | +----------------------------------------------------------+----------------------------------------------+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+