nustack

set_interactions

Set interactions.

Module nu.forms.collections.abc.set_interactions.

Set interactions.

Reads (Query): Union, Intersection, Difference, SymmetricDifference IsSubset, IsSuperset, IsDisjoint Copy

Mutations that return nothing (Command): AddCmd, Remove, Discard SetUpdate, IntersectionUpdate, DifferenceUpdate, SymmetricDifferenceUpdate

Mutations that return a value (Action): SetPop (set.pop returns an arbitrary element)

NameSortCallMeaning
AddCmdscalar_commandAddCmd()Add element to set: s.add(value). Mutates the set; returns nothing.
Differencescalar_queryDifference()Set difference: left.difference(right). Returns a new set.
DifferenceUpdatescalar_commandDifferenceUpdate()Remove elements found in other: s.difference_update(other). Mutates the set; returns nothing.
Discardscalar_commandDiscard()Discard element from set: s.discard(value). Mutates the set; returns nothing.
Intersectionscalar_queryIntersection()Set intersection: left.intersection(right). Returns a new set.
IntersectionUpdatescalar_commandIntersectionUpdate()Keep only elements found in both: s.intersection_update(other).
IsDisjointscalar_queryIsDisjoint()Test if disjoint: left.isdisjoint(right). Returns a bool.
IsSubsetscalar_queryIsSubset()Test if subset: left <= right. Returns a bool.
IsSupersetscalar_queryIsSuperset()Test if superset: left >= right. Returns a bool.
Removescalar_commandRemove(target, value, missing_ok=False)Remove element from set: s.remove(value). Mutates the set; returns nothing.
SetPopscalar_actionSetPop()Pop arbitrary element: s.pop(). Mutates the set; returns the element.
SetUpdatescalar_commandSetUpdate()Update set with elements from other: s.update(other). Mutates the set; returns nothing.
SymmetricDifferencescalar_querySymmetricDifference()Set symmetric difference: left.symmetric_difference(right). Returns a new set.
SymmetricDifferenceUpdatescalar_commandSymmetricDifferenceUpdate()Keep elements in either but not both: s.symmetric_difference_update(other).
Unionscalar_queryUnion()Set union: left.union(right). Returns a new set.

AddCmd

Add element to set: s.add(value). Mutates the set; returns nothing.

AddCmd()

Path nu.forms.collections.abc.AddCmd. Kind Command, sort scalar_command, cardinality void.

Undocumented: yields, example.

Difference

Set difference: left.difference(right). Returns a new set.

Difference()

Path nu.forms.collections.abc.Difference. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

DifferenceUpdate

Remove elements found in other: s.difference_update(other). Mutates the set; returns nothing.

DifferenceUpdate()

Path nu.forms.collections.abc.DifferenceUpdate. Kind Command, sort scalar_command, cardinality void.

Undocumented: yields, example.

Discard

Discard element from set: s.discard(value). Mutates the set; returns nothing.

Discard()

Path nu.forms.collections.abc.Discard. Kind Command, sort scalar_command, cardinality void.

No error if the element is absent (Python parity).

Undocumented: yields, example.

Intersection

Set intersection: left.intersection(right). Returns a new set.

Intersection()

Path nu.forms.collections.abc.Intersection. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

IntersectionUpdate

Keep only elements found in both: s.intersection_update(other).

IntersectionUpdate()

Path nu.forms.collections.abc.IntersectionUpdate. Kind Command, sort scalar_command, cardinality void.

Mutates the set; returns nothing.

Undocumented: yields, example.

IsDisjoint

Test if disjoint: left.isdisjoint(right). Returns a bool.

IsDisjoint()

Path nu.forms.collections.abc.IsDisjoint. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

IsSubset

Test if subset: left <= right. Returns a bool.

IsSubset()

Path nu.forms.collections.abc.IsSubset. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

IsSuperset

Test if superset: left >= right. Returns a bool.

IsSuperset()

Path nu.forms.collections.abc.IsSuperset. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

Remove

Remove element from set: s.remove(value). Mutates the set; returns nothing.

Remove(target, value, missing_ok=False)

Path nu.forms.collections.abc.Remove. Kind Command, sort scalar_command, cardinality void. Arity 3 (2 required).

Raises KeyError if the element is absent (Python parity), unless the construction-time missing_ok flag (carried in the payload) is set, which makes an absent element a no-op.

Arguments

NameTypeDefaultMeaning
targetobject
valueobject
missing_okboolFalse

Undocumented: yields, example.

SetPop

Pop arbitrary element: s.pop(). Mutates the set; returns the element.

SetPop()

Path nu.forms.collections.abc.SetPop. Kind ScalarAction, sort scalar_action, cardinality scalar.

EMPTY if the set is empty.

Undocumented: yields, example.

SetUpdate

Update set with elements from other: s.update(other). Mutates the set; returns nothing.

SetUpdate()

Path nu.forms.collections.abc.SetUpdate. Kind Command, sort scalar_command, cardinality void.

Undocumented: yields, example.

SymmetricDifference

Set symmetric difference: left.symmetric_difference(right). Returns a new set.

SymmetricDifference()

Path nu.forms.collections.abc.SymmetricDifference. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

SymmetricDifferenceUpdate

Keep elements in either but not both: s.symmetric_difference_update(other).

SymmetricDifferenceUpdate()

Path nu.forms.collections.abc.SymmetricDifferenceUpdate. Kind Command, sort scalar_command, cardinality void.

Mutates the set; returns nothing.

Undocumented: yields, example.

Union

Set union: left.union(right). Returns a new set.

Union()

Path nu.forms.collections.abc.Union. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Undocumented: yields, example.

On this page