nustack
ReferenceNuformscollectionsabc

set_interactions

Set interactions.

Module nu.forms.collections.abc.set_interactions.

Set interactions.

Reads (Query): Union, Intersection, Difference, SymmetricDifference IsSubset, IsSuperset, IsDisjoint Copy SetOr, SetAnd, SetSub, SetXor

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) SetIOr, SetIAnd, SetISub, SetIXor (in-place operators return self)

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()Remove element from set: s.remove(value). Mutates the set; returns nothing.
SetAndscalar_querySetAnd()Set intersection operator: left & right. Returns a new set.
SetIAndscalar_actionSetIAnd()In-place intersection: left &= right. Mutates the set; returns the set.
SetIOrscalar_actionSetIOr()In-place union: left |= right. Mutates the set; returns the set.
SetISubscalar_actionSetISub()In-place difference: left -= right. Mutates the set; returns the set.
SetIXorscalar_actionSetIXor()In-place symmetric difference: left ^= right. Mutates the set; returns the set.
SetOrscalar_querySetOr()Set union operator: left | right. Returns a new set.
SetPopscalar_actionSetPop()Pop arbitrary element: s.pop(). Mutates the set; returns the element.
SetSubscalar_querySetSub()Set difference operator: left - right. Returns a new set.
SetUpdatescalar_commandSetUpdate()Update set with elements from other: s.update(other). Mutates the set; returns nothing.
SetXorscalar_querySetXor()Set symmetric difference operator: left ^ right. Returns a new set.
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()

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

Raises KeyError if the element is absent (Python parity).

Undocumented: yields, example.

SetAnd

Set intersection operator: left & right. Returns a new set.

SetAnd()

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

Undocumented: yields, example.

SetIAnd

In-place intersection: left &= right. Mutates the set; returns the set.

SetIAnd()

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

Undocumented: yields, example.

SetIOr

In-place union: left |= right. Mutates the set; returns the set.

SetIOr()

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

Undocumented: yields, example.

SetISub

In-place difference: left -= right. Mutates the set; returns the set.

SetISub()

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

Undocumented: yields, example.

SetIXor

In-place symmetric difference: left ^= right. Mutates the set; returns the set.

SetIXor()

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

Undocumented: yields, example.

SetOr

Set union operator: left | right. Returns a new set.

SetOr()

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

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.

Returns INVALID if the set is empty (Python raises KeyError).

Undocumented: yields, example.

SetSub

Set difference operator: left - right. Returns a new set.

SetSub()

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

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.

SetXor

Set symmetric difference operator: left ^ right. Returns a new set.

SetXor()

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

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