sequence
Shape-domain Sequence Form glue: tier-by-tier composition.
Module nu.domains.shape.forms.sequence.
Shape-domain Sequence Form glue: tier-by-tier composition.
SequenceForm = generic SequenceForm + shape CollectionForm MutableSequenceForm = generic MutableSequenceForm + shape MutableCollectionForm ReactiveSequenceForm = generic ReactiveSequenceForm + shape MutableSequenceForm + shape ReactiveCollectionForm
The Reactive tier brings together:
on_change()from generic ReactiveSequenceForm (generic)on_child_change()etc from shape ReactiveCollectionForm (shape-domain)
| Name | Call | Meaning |
|---|---|---|
| MutableSequenceForm | MutableSequenceForm() | Mutable shape sequence: ordered-element ops + exists/missing/extract + set/erase. |
| ReactiveSequenceForm | ReactiveSequenceForm() | Reactive shape sequence. Adds on_change + tree-aware on_child_change* family. |
| SequenceForm | SequenceForm() | Shape sequence: ordered-element ops + exists/missing/extract. |
MutableSequenceForm
Mutable shape sequence: ordered-element ops + exists/missing/extract + set/erase.
MutableSequenceForm()Path nu.domains.shape.forms.MutableSequenceForm.
Inherited methods
From nu.forms.collections.abc.sequence.MutableSequenceForm:
| Call | Builds | Meaning |
|---|---|---|
.append(value) | Any | Append value to the end of self. |
.extend(other) | Any | Extend self with the elements of other, in order. |
.insert(index, value) | Any | Insert value at index, shifting later elements right. |
.pop(index=-1) | ElementResultT | Remove and return the element at index. |
.del_at(index) | Any | Remove the element at index. |
.remove(value) | Any | Remove the first occurrence of value. |
.reverse() | Any | Reverse self in place. |
.sort() | Any | Sort self in place, ascending, using the elements' natural order. |
.copy() | CollectionResultT | Shallow copy of self: a new sequence with the same elements. |
.clear() | Any | Remove every element from self. |
From nu.forms.collections.abc.sequence.SequenceForm:
| Call | Builds | Meaning |
|---|---|---|
a[key] | ElementResultT | CollectionResultT | Element at an int index, or subsequence for a slice. |
.first_elem() | ElementResultT | First element of self. |
.last_elem() | ElementResultT | Last element of self. |
.index(value) | Int | Lowest index in self where value is found, searching from the left. |
.count(value) | Int | Count of occurrences of value in self. |
.reversed() | CollectionResultT | Self walked back to front, as a stream. |
From nu.forms.collections.abc.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.extract() | object | Materialise the full subtree rooted at self. |
From nu.forms.collections.abc.sized.SizedForm:
| Call | Builds | Meaning |
|---|---|---|
.len() | Int | Length of self. |
From nu.forms.collections.abc.iterable.IterableForm:
| Call | Builds | Meaning |
|---|---|---|
iter(a) | Iterator[ElementT] | Open self into a lazy iterator stream (Python's iter). |
From nu.forms.collections.abc.container.ContainerForm:
| Call | Builds | Meaning |
|---|---|---|
.contains(item) | Bool | Whether item is a member of self. |
From nu.forms.collections.abc.sliceable.SliceableForm:
| Call | Builds | Meaning |
|---|---|---|
.slice(start, stop, step=None) | ResultT | Slice of self from start to stop, stepping by step. |
From nu.domains.shape.forms.collection.MutableCollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.set(value) | SetCmd | Build a SetCmd. |
.erase() | Erase | Build an Erase. |
.init(value) | IfDo | Set value iff the collection is currently missing. |
From nu.domains.shape.forms.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.exists() | Exists | Build an Exists query. |
.missing() | Missing | Build a Missing query. |
From nu.lang.forms.Form:
| Call | Builds | Meaning |
|---|---|---|
.is_empty() | Bool | True if this Form yields the EMPTY sentinel. |
.is_invalid() | Bool | True if this Form yields the INVALID sentinel. |
.is_sentinel() | Bool | True if this Form yields either sentinel (EMPTY or INVALID). |
.not_empty() | Bool | True if this Form does not yield EMPTY. |
.not_invalid() | Bool | True if this Form does not yield INVALID. |
From builtins.object:
| Call | Builds | Meaning |
|---|---|---|
a < b | Return self<value. | |
a <= b | Return self<=value. | |
a == b | Return self==value. | |
a != b | Return self!=value. | |
a > b | Return self>value. | |
a >= b | Return self>=value. |
Undocumented: example.
ReactiveSequenceForm
Reactive shape sequence. Adds on_change + tree-aware on_child_change* family.
ReactiveSequenceForm()Path nu.domains.shape.forms.ReactiveSequenceForm.
Inherited methods
From nu.forms.collections.abc.sequence.ReactiveSequenceForm:
| Call | Builds | Meaning |
|---|---|---|
.on_change() | object | Subscribe to any change on this sequence slot. |
From nu.forms.collections.abc.sequence.MutableSequenceForm:
| Call | Builds | Meaning |
|---|---|---|
.append(value) | Any | Append value to the end of self. |
.extend(other) | Any | Extend self with the elements of other, in order. |
.insert(index, value) | Any | Insert value at index, shifting later elements right. |
.pop(index=-1) | ElementResultT | Remove and return the element at index. |
.del_at(index) | Any | Remove the element at index. |
.remove(value) | Any | Remove the first occurrence of value. |
.reverse() | Any | Reverse self in place. |
.sort() | Any | Sort self in place, ascending, using the elements' natural order. |
.copy() | CollectionResultT | Shallow copy of self: a new sequence with the same elements. |
.clear() | Any | Remove every element from self. |
From nu.forms.collections.abc.sequence.SequenceForm:
| Call | Builds | Meaning |
|---|---|---|
a[key] | ElementResultT | CollectionResultT | Element at an int index, or subsequence for a slice. |
.first_elem() | ElementResultT | First element of self. |
.last_elem() | ElementResultT | Last element of self. |
.index(value) | Int | Lowest index in self where value is found, searching from the left. |
.count(value) | Int | Count of occurrences of value in self. |
.reversed() | CollectionResultT | Self walked back to front, as a stream. |
From nu.forms.collections.abc.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.extract() | object | Materialise the full subtree rooted at self. |
From nu.forms.collections.abc.sized.SizedForm:
| Call | Builds | Meaning |
|---|---|---|
.len() | Int | Length of self. |
From nu.forms.collections.abc.iterable.IterableForm:
| Call | Builds | Meaning |
|---|---|---|
iter(a) | Iterator[ElementT] | Open self into a lazy iterator stream (Python's iter). |
From nu.forms.collections.abc.container.ContainerForm:
| Call | Builds | Meaning |
|---|---|---|
.contains(item) | Bool | Whether item is a member of self. |
From nu.forms.collections.abc.sliceable.SliceableForm:
| Call | Builds | Meaning |
|---|---|---|
.slice(start, stop, step=None) | ResultT | Slice of self from start to stop, stepping by step. |
From nu.domains.shape.forms.collection.ReactiveCollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.on_child_change(address) | OnChildChange | Observe changes at a specific child address. |
.on_children_change() | OnChildrenChange | Observe changes across all direct children. |
.on_descendants_change() | OnDescendantsChange | Observe changes across descendants matching pattern. |
From nu.domains.shape.forms.collection.MutableCollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.set(value) | SetCmd | Build a SetCmd. |
.erase() | Erase | Build an Erase. |
.init(value) | IfDo | Set value iff the collection is currently missing. |
From nu.domains.shape.forms.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.exists() | Exists | Build an Exists query. |
.missing() | Missing | Build a Missing query. |
From nu.lang.forms.Form:
| Call | Builds | Meaning |
|---|---|---|
.is_empty() | Bool | True if this Form yields the EMPTY sentinel. |
.is_invalid() | Bool | True if this Form yields the INVALID sentinel. |
.is_sentinel() | Bool | True if this Form yields either sentinel (EMPTY or INVALID). |
.not_empty() | Bool | True if this Form does not yield EMPTY. |
.not_invalid() | Bool | True if this Form does not yield INVALID. |
From builtins.object:
| Call | Builds | Meaning |
|---|---|---|
a < b | Return self<value. | |
a <= b | Return self<=value. | |
a == b | Return self==value. | |
a != b | Return self!=value. | |
a > b | Return self>value. | |
a >= b | Return self>=value. |
Undocumented: example.
SequenceForm
Shape sequence: ordered-element ops + exists/missing/extract.
SequenceForm()Path nu.domains.shape.forms.SequenceForm.
Inherited methods
From nu.forms.collections.abc.sequence.SequenceForm:
| Call | Builds | Meaning |
|---|---|---|
a[key] | ElementResultT | CollectionResultT | Element at an int index, or subsequence for a slice. |
.first_elem() | ElementResultT | First element of self. |
.last_elem() | ElementResultT | Last element of self. |
.index(value) | Int | Lowest index in self where value is found, searching from the left. |
.count(value) | Int | Count of occurrences of value in self. |
.reversed() | CollectionResultT | Self walked back to front, as a stream. |
From nu.forms.collections.abc.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.extract() | object | Materialise the full subtree rooted at self. |
From nu.forms.collections.abc.sized.SizedForm:
| Call | Builds | Meaning |
|---|---|---|
.len() | Int | Length of self. |
From nu.forms.collections.abc.iterable.IterableForm:
| Call | Builds | Meaning |
|---|---|---|
iter(a) | Iterator[ElementT] | Open self into a lazy iterator stream (Python's iter). |
From nu.forms.collections.abc.container.ContainerForm:
| Call | Builds | Meaning |
|---|---|---|
.contains(item) | Bool | Whether item is a member of self. |
From nu.forms.collections.abc.sliceable.SliceableForm:
| Call | Builds | Meaning |
|---|---|---|
.slice(start, stop, step=None) | ResultT | Slice of self from start to stop, stepping by step. |
From nu.domains.shape.forms.collection.CollectionForm:
| Call | Builds | Meaning |
|---|---|---|
.exists() | Exists | Build an Exists query. |
.missing() | Missing | Build a Missing query. |
From nu.lang.forms.Form:
| Call | Builds | Meaning |
|---|---|---|
.is_empty() | Bool | True if this Form yields the EMPTY sentinel. |
.is_invalid() | Bool | True if this Form yields the INVALID sentinel. |
.is_sentinel() | Bool | True if this Form yields either sentinel (EMPTY or INVALID). |
.not_empty() | Bool | True if this Form does not yield EMPTY. |
.not_invalid() | Bool | True if this Form does not yield INVALID. |
From builtins.object:
| Call | Builds | Meaning |
|---|---|---|
a < b | Return self<value. | |
a <= b | Return self<=value. | |
a == b | Return self==value. | |
a != b | Return self!=value. | |
a > b | Return self>value. | |
a >= b | Return self>=value. |
Undocumented: example.