nustack

set_

Set family: an unordered collection of unique elements in a shape fabric.

Module nu.domains.shape.set_.

Set family: an unordered collection of unique elements in a shape fabric.

Forms weave the Python set surface with the shape collection ops, tier by tier, and type every result by what the slot declared: an element reads as the declared value's form, and set algebra carries the declared element type on.

Refs bind that surface to an address. A set has no keys, so there is no descent.

NameSortCallMeaning
MutableSetRefrefMutableSetRef(address, parent_ref=None, owner_shape=None)Mutable unordered unique-element container Ref.
ReactiveSetRefrefReactiveSetRef(address, parent_ref=None, owner_shape=None)Reactive unordered unique-element container Ref.
SetRefrefSetRef(address, parent_ref=None, owner_shape=None)Unordered unique-element container Ref; no child descent.

MutableSetRef

Mutable unordered unique-element container Ref.

MutableSetRef(address, parent_ref=None, owner_shape=None)

Path nu.domains.shape.MutableSetRef. Kind Ref, sort ref, cardinality scalar.

Adds: add(v), remove(v), discard(v), pop(), update(), ..., store(v), erase().

Inherited methods

From nu.forms.collections.abc.set_.MutableSetForm:

CallBuildsMeaning
.add(value)AnyAdd value to self.
.remove(value, missing_ok=False)AnyRemove value from self.
.discard(value)AnyRemove value from self if present.
.pop()ElementResultTRemove and return an arbitrary element from self.
.clear()AnyRemove every element from self.
.update(other)AnyAdd every element of other to self.
.intersection_update(other)AnyKeep only the elements of self also found in other.
.difference_update(other)AnyRemove every element of other from self.
.symmetric_difference_update(other)AnyKeep the elements in exactly one of self and other.

From nu.domains.shape.set_.SetLikeForm:

CallBuildsMeaning
.iter()IteratorA lazy stream over its elements, typed by the declared value.

From nu.forms.collections.abc.set_.SetLikeForm:

CallBuildsMeaning
.union(other)CollectionResultTUnion of self and other.
.intersection(other)CollectionResultTIntersection of self and other.
.difference(other)CollectionResultTElements of self that are not in other.
.symmetric_difference(other)CollectionResultTElements in exactly one of self and other, not both.
.issubset(other)BoolWhether every element of self is in other.
.issuperset(other)BoolWhether every element of other is in self.
.isdisjoint(other)BoolWhether self and other share no elements.
.copy()CollectionResultTShallow copy of self.

From nu.forms.collections.abc.collection.CollectionForm:

CallBuildsMeaning
.extract()objectMaterialise the full subtree rooted at self.

From nu.forms.collections.abc.sized.SizedForm:

CallBuildsMeaning
.len()IntLength of self.

From nu.forms.collections.abc.container.ContainerForm:

CallBuildsMeaning
.contains(item)BoolWhether item is a member of self.

From nu.domains.shape.collection.MutableCollectionForm:

CallBuildsMeaning
.set(value)SetCmdBuild a SetCmd.
.erase()EraseBuild an Erase.
.init(value)IfDoSet value iff the collection is currently missing.

From nu.domains.shape.collection.CollectionForm:

CallBuildsMeaning
.exists()BoolWhether this collection slot holds a value, as a Bool.
.missing()BoolWhether this slot holds no value, as a Bool: the negation of exists().

From nu.lang.forms.Form:

CallBuildsMeaning
a == bBoolSelf equal to other by value: an Eq term, never a Python bool.
a != bBoolSelf not equal to other by value: a Ne term, never a Python bool.
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.not_empty()BoolTrue if this Form does not yield EMPTY.
.fallback(*alternatives)SelfThe first of this value and alternatives that is not EMPTY.

Undocumented: example.

ReactiveSetRef

Reactive unordered unique-element container Ref.

ReactiveSetRef(address, parent_ref=None, owner_shape=None)

Path nu.domains.shape.ReactiveSetRef. Kind Ref, sort ref, cardinality scalar.

Adds: on_change(), on_child_change(), on_children_change(), on_descendants_change() on top of MutableSetRef.

Inherited methods

From nu.forms.collections.abc.set_.ReactiveSetForm:

CallBuildsMeaning
.on_change()objectSubscribe to any change on this set slot.

From nu.forms.collections.abc.set_.MutableSetForm:

CallBuildsMeaning
.add(value)AnyAdd value to self.
.remove(value, missing_ok=False)AnyRemove value from self.
.discard(value)AnyRemove value from self if present.
.pop()ElementResultTRemove and return an arbitrary element from self.
.clear()AnyRemove every element from self.
.update(other)AnyAdd every element of other to self.
.intersection_update(other)AnyKeep only the elements of self also found in other.
.difference_update(other)AnyRemove every element of other from self.
.symmetric_difference_update(other)AnyKeep the elements in exactly one of self and other.

From nu.domains.shape.set_.SetLikeForm:

CallBuildsMeaning
.iter()IteratorA lazy stream over its elements, typed by the declared value.

From nu.forms.collections.abc.set_.SetLikeForm:

CallBuildsMeaning
.union(other)CollectionResultTUnion of self and other.
.intersection(other)CollectionResultTIntersection of self and other.
.difference(other)CollectionResultTElements of self that are not in other.
.symmetric_difference(other)CollectionResultTElements in exactly one of self and other, not both.
.issubset(other)BoolWhether every element of self is in other.
.issuperset(other)BoolWhether every element of other is in self.
.isdisjoint(other)BoolWhether self and other share no elements.
.copy()CollectionResultTShallow copy of self.

From nu.forms.collections.abc.collection.CollectionForm:

CallBuildsMeaning
.extract()objectMaterialise the full subtree rooted at self.

From nu.forms.collections.abc.sized.SizedForm:

CallBuildsMeaning
.len()IntLength of self.

From nu.forms.collections.abc.container.ContainerForm:

CallBuildsMeaning
.contains(item)BoolWhether item is a member of self.

From nu.domains.shape.collection.ReactiveCollectionForm:

CallBuildsMeaning
.on_child_change(address)OnChildChangeObserve writes at one child's own address; for its subtree use on_descendants_change.
.on_children_change()OnChildrenChangeObserve writes at the direct children only; for subtrees use on_descendants_change.
.on_descendants_change()OnDescendantsChangeObserve changes across descendants matching pattern.

From nu.domains.shape.collection.MutableCollectionForm:

CallBuildsMeaning
.set(value)SetCmdBuild a SetCmd.
.erase()EraseBuild an Erase.
.init(value)IfDoSet value iff the collection is currently missing.

From nu.domains.shape.collection.CollectionForm:

CallBuildsMeaning
.exists()BoolWhether this collection slot holds a value, as a Bool.
.missing()BoolWhether this slot holds no value, as a Bool: the negation of exists().

From nu.lang.forms.Form:

CallBuildsMeaning
a == bBoolSelf equal to other by value: an Eq term, never a Python bool.
a != bBoolSelf not equal to other by value: a Ne term, never a Python bool.
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.not_empty()BoolTrue if this Form does not yield EMPTY.
.fallback(*alternatives)SelfThe first of this value and alternatives that is not EMPTY.

Undocumented: example.

SetRef

Unordered unique-element container Ref; no child descent.

SetRef(address, parent_ref=None, owner_shape=None)

Path nu.domains.shape.SetRef. Kind Ref, sort ref, cardinality scalar.

Inherited methods

From nu.domains.shape.set_.SetLikeForm:

CallBuildsMeaning
.iter()IteratorA lazy stream over its elements, typed by the declared value.

From nu.forms.collections.abc.set_.SetLikeForm:

CallBuildsMeaning
.union(other)CollectionResultTUnion of self and other.
.intersection(other)CollectionResultTIntersection of self and other.
.difference(other)CollectionResultTElements of self that are not in other.
.symmetric_difference(other)CollectionResultTElements in exactly one of self and other, not both.
.issubset(other)BoolWhether every element of self is in other.
.issuperset(other)BoolWhether every element of other is in self.
.isdisjoint(other)BoolWhether self and other share no elements.
.copy()CollectionResultTShallow copy of self.

From nu.forms.collections.abc.collection.CollectionForm:

CallBuildsMeaning
.extract()objectMaterialise the full subtree rooted at self.

From nu.forms.collections.abc.sized.SizedForm:

CallBuildsMeaning
.len()IntLength of self.

From nu.forms.collections.abc.container.ContainerForm:

CallBuildsMeaning
.contains(item)BoolWhether item is a member of self.

From nu.domains.shape.collection.CollectionForm:

CallBuildsMeaning
.exists()BoolWhether this collection slot holds a value, as a Bool.
.missing()BoolWhether this slot holds no value, as a Bool: the negation of exists().

From nu.lang.forms.Form:

CallBuildsMeaning
a == bBoolSelf equal to other by value: an Eq term, never a Python bool.
a != bBoolSelf not equal to other by value: a Ne term, never a Python bool.
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.not_empty()BoolTrue if this Form does not yield EMPTY.
.fallback(*alternatives)SelfThe first of this value and alternatives that is not EMPTY.

Undocumented: example.

On this page