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)
| Name | Sort | Call | Meaning |
|---|---|---|---|
| AddCmd | scalar_command | AddCmd() | Add element to set: s.add(value). Mutates the set; returns nothing. |
| Difference | scalar_query | Difference() | Set difference: left.difference(right). Returns a new set. |
| DifferenceUpdate | scalar_command | DifferenceUpdate() | Remove elements found in other: s.difference_update(other). Mutates the set; returns nothing. |
| Discard | scalar_command | Discard() | Discard element from set: s.discard(value). Mutates the set; returns nothing. |
| Intersection | scalar_query | Intersection() | Set intersection: left.intersection(right). Returns a new set. |
| IntersectionUpdate | scalar_command | IntersectionUpdate() | Keep only elements found in both: s.intersection_update(other). |
| IsDisjoint | scalar_query | IsDisjoint() | Test if disjoint: left.isdisjoint(right). Returns a bool. |
| IsSubset | scalar_query | IsSubset() | Test if subset: left <= right. Returns a bool. |
| IsSuperset | scalar_query | IsSuperset() | Test if superset: left >= right. Returns a bool. |
| Remove | scalar_command | Remove() | Remove element from set: s.remove(value). Mutates the set; returns nothing. |
| SetAnd | scalar_query | SetAnd() | Set intersection operator: left & right. Returns a new set. |
| SetIAnd | scalar_action | SetIAnd() | In-place intersection: left &= right. Mutates the set; returns the set. |
| SetIOr | scalar_action | SetIOr() | In-place union: left |= right. Mutates the set; returns the set. |
| SetISub | scalar_action | SetISub() | In-place difference: left -= right. Mutates the set; returns the set. |
| SetIXor | scalar_action | SetIXor() | In-place symmetric difference: left ^= right. Mutates the set; returns the set. |
| SetOr | scalar_query | SetOr() | Set union operator: left | right. Returns a new set. |
| SetPop | scalar_action | SetPop() | Pop arbitrary element: s.pop(). Mutates the set; returns the element. |
| SetSub | scalar_query | SetSub() | Set difference operator: left - right. Returns a new set. |
| SetUpdate | scalar_command | SetUpdate() | Update set with elements from other: s.update(other). Mutates the set; returns nothing. |
| SetXor | scalar_query | SetXor() | Set symmetric difference operator: left ^ right. Returns a new set. |
| SymmetricDifference | scalar_query | SymmetricDifference() | Set symmetric difference: left.symmetric_difference(right). Returns a new set. |
| SymmetricDifferenceUpdate | scalar_command | SymmetricDifferenceUpdate() | Keep elements in either but not both: s.symmetric_difference_update(other). |
| Union | scalar_query | Union() | 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.