Title: Theory / Unimportant / CS / Programming / Python / Lib / built-in types / set;
Tags: FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning some_instruction automatedNewLineAfterCommaSpace
On every note of this deck, unless a note says otherwise:
Page: https://docs.python.org/3/library/stdtypes.html#frozenset
Language: Python

Instruction: s_1.symmetric_difference(s_2)
Effect: The elements belonging to exactly one of those sets
Variables: s_1, s_2 (frozen)set
Abbreviation: s_1^ s_2

Instruction: s1 == s2
Returns: whether s1 and s2 have the same elements
Variables: s1,s2 (frozen)set

Instruction: s.update(s_1,...,s_n)
Effect: adds elements of s__i to s
Variables: s,s_1,...,s_n set
Abbreviation: s|=s1,...,sn

Instruction: s.difference_update(s_1,...,s_n)
Effect: remove elements of s__i to s
Variables: s,s_1,...,s_n set
Abbreviation: s-=s1,...,sn

Instruction: s.symmetric_difference_update(s_1)
Effect: s adds/remove each elements of s_1 if it does not belong to/belongs to s
Variables: s,s_1,...,s_n set
Abbreviation: s^=s_1

Instruction: s.intersection_update(s_1,...,s_n)
Effect: keeps only elements belonging to each s__i in s
Variables: s,s_1,...,s_n set
Abbreviation: s&=s_1&...&s_n

Instruction: s.add(x)
Effect: add x to s
Variables: s a set

Instruction: s.remove(x)
Effect: remove x from s
raise KeyError if x was not in s
Variables: s a set
x

Instruction: s.discard(x)
Effect: remove x from s
Variables: s a set
x

Instruction: s.pop()
Effect: remove the returned element
Returns: an arbitrary element from s
Variables: s a set

Instruction: frozenset(foo)
Returns: A frozen set containing the elements of foo.

Instruction: s.isdisjoint(t)
Returns: Whether s and t are disjoint
Variables: s,t a (frozen)set

Instruction: s.issuperset(t)
Returns: Whether s is a superset of t
Variables: s,t a (frozen)set
Abbreviation: s<= t,
t>=s,

Instruction: s < t, t>s
Effect: s is a strict subset of t
Variables: s,t (frozen)set

Instruction: s_1.union(
  s_2,
  ...,
  s_n
)
Effect: a set which is the union of the s_i
Variables: s_1,
  ...,
  s_n (
  frozen
)set
Abbreviation: s_1| ...| s_n

Instruction: s_1.intersection(
  s_2,
  ...,
  s_n
)
Effect: a set which is the intersection of the s_i
Variables: s_1,
  ...,
  s_n (
  frozen
)set
Abbreviation: s_1& ...& s_n

Instruction: s_1.difference(
  s_2,
  ...,
  s_n
)
Effect: The content of s_1 without its other elements
Variables: s_1,
  ...,
  s_n (
  frozen
)set
Abbreviation: s_1- ...- s_n

Question: How are set encoded
Answer: Essentially as dict without value
Page: https://wiki.python.org/moin/TimeComplexity
Context: Python

Instruction: s.issubset(t)
Returns: Whether s is a subset of t
Variables: s,t a (frozen)set
Abbreviation: s<= t,

Instruction: set(foo)
Returns: A set containing the elements of foo. Empty if foo is not given

Instruction: set()
Returns: An empty set

Instruction: frozentset()
Returns: An empty frozen set