sets.make

Creates a new set.

All elements must be hashable.

PARAMETERS

NameDescriptionDefault Value
elementsOptional sequence to construct the set out of.None

sets.copy

Creates a new set from another set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none

sets.to_list

Creates a list from the values in the set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none

sets.insert

Inserts an element into the set.

Element must be hashable. This mutates the original set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none
eThe element to be inserted.none

sets.contains

Checks for the existence of an element in a set.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
eThe element to look for.none

sets.is_equal

Returns whether two sets are equal.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
bA set, as returned by sets.make().none

sets.is_subset

Returns whether a is a subset of b.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
bA set, as returned by sets.make().none

sets.disjoint

Returns whether two sets are disjoint.

Two sets are disjoint if they have no elements in common.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
bA set, as returned by sets.make().none

sets.intersection

Returns the intersection of two sets.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
bA set, as returned by sets.make().none

sets.union

Returns the union of several sets.

PARAMETERS

NameDescriptionDefault Value
argsAn arbitrary number of sets.none

sets.difference

Returns the elements in a that are not in b.

PARAMETERS

NameDescriptionDefault Value
aA set, as returned by sets.make().none
bA set, as returned by sets.make().none

sets.length

Returns the number of elements in a set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none

sets.remove

Removes an element from the set.

Element must be hashable. This mutates the original set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none
eThe element to be removed.none

sets.repr

Returns a string value representing the set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none

sets.str

Returns a string value representing the set.

PARAMETERS

NameDescriptionDefault Value
sA set, as returned by sets.make().none