nustack

primitives.sentinel_

Sentinel interfaces - SentinelForm, EmptyForm.

Module nu.forms.primitives.sentinel_.

Sentinel interfaces - SentinelForm, EmptyForm.

Wraps EMPTY so it can appear as a typed Form node in a Nu tree, mainly so is_empty() has something typed to call on.

NameSortCallMeaning
EmptyFormscalar_queryEmptyForm()Wraps EMPTY, the no-value sentinel.
SentinelFormscalar_querySentinelForm()Base for the sentinel interfaces.

EmptyForm

Wraps EMPTY, the no-value sentinel.

EmptyForm()

Path nu.forms.EmptyForm. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Example

nu.run(nu.EmptyForm())[0]
<EMPTY>

Inherited methods

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.

SentinelForm

Base for the sentinel interfaces.

SentinelForm()

Path nu.forms.SentinelForm. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Inherited methods

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