set.intersection_update()

intersection_update(other, ...) set &= other & ... Update the set, keeping only elements found in it and all others.

set.intersection()

intersection(other, ...) set & other & ... Return a new set with elements common to the set and all others.

set.discard()

discard(elem) Remove element elem from the set if it is present.

set.difference_update()

difference_update(other, ...) set -= other | ... Update the set, removing elements found in others.

set.difference()

difference(other, ...) set - other - ... Return a new set with elements in the set that are not in the others.

set.copy()

copy() Return a new set with a shallow copy of s.

set.clear()

clear() Remove all elements from the set.

set.add()

add(elem) Add element elem to the set.

set

class set([iterable]) Return a new set object, optionally with elements taken from iterable. set is a built-in class. See set and Set Types — set, frozenset for documentation about this class. For other containers see the built-in frozenset, list, tuple, and dict classes, as well as the collections module.

set

class set([iterable]) class frozenset([iterable]) Return a new set or frozenset object whose elements are taken from iterable. The elements of a set must be hashable. To represent sets of sets, the inner sets must be frozenset objects. If iterable is not specified, a new empty set is returned. Instances of set and frozenset provide the following operations: len(s) Return the number of elements in set s (cardinality of s). x in s Test x for membership in s. x not in s Test x for