This subtype of PyObject is used to hold the internal data for both
set and frozenset objects. It is like a PyDictObject
in that it is a fixed size for small sets (much like tuple storage) and will
point to a separate, variable sized block of memory for medium and large sized
sets (much like list storage). None of the fields of this structure should be
considered public and are subject to change. All access should be done through
the documented API rather than by manipulating the values in the structure.

Return a new set containing objects returned by the iterable. The
iterable may be NULL to create a new empty set. Return the new set on
success or NULL on failure. Raise TypeError if iterable is not
actually iterable. The constructor is also useful for copying a set
(c=set(s)).

Return a new frozenset containing objects returned by the iterable.
The iterable may be NULL to create a new empty frozenset. Return the new
set on success or NULL on failure. Raise TypeError if iterable is
not actually iterable.

Changed in version 2.6: Now guaranteed to return a brand-new frozenset. Formerly,
frozensets of zero-length were a singleton. This got in the way of
building-up new frozensets with PySet_Add().

The following functions and macros are available for instances of set
or frozenset or instances of their subtypes.

Return 1 if found, 0 if not found, and -1 if an error is encountered. Unlike
the Python __contains__() method, this function does not automatically
convert unhashable sets into temporary frozensets. Raise a TypeError if
the key is unhashable. Raise PyExc_SystemError if anyset is not a
set, frozenset, or an instance of a subtype.

Add key to a set instance. Does not apply to frozenset
instances. Return 0 on success or -1 on failure. Raise a TypeError if
the key is unhashable. Raise a MemoryError if there is no room to grow.
Raise a SystemError if set is not an instance of set or its
subtype.

Changed in version 2.6: Now works with instances of frozenset or its subtypes.
Like PyTuple_SetItem() in that it can be used to fill-in the
values of brand new frozensets before they are exposed to other code.

The following functions are available for instances of set or its
subtypes but not for instances of frozenset or its subtypes.

Return 1 if found and removed, 0 if not found (no action taken), and -1 if an
error is encountered. Does not raise KeyError for missing keys. Raise a
TypeError if the key is unhashable. Unlike the Python discard()
method, this function does not automatically convert unhashable sets into
temporary frozensets. Raise PyExc_SystemError if set is not an
instance of set or its subtype.

Return a new reference to an arbitrary object in the set, and removes the
object from the set. Return NULL on failure. Raise KeyError if the
set is empty. Raise a SystemError if set is not an instance of
set or its subtype.