Some#

class hugr.val.Some(*vals: Value)[source]#

Bases: Sum

Optional tuple of value, containing a list of values.

Example

>>> some = Some(TRUE, FALSE)
>>> str(some)
'Some(TRUE, FALSE)'
>>> some.type_()
Option(Bool, Bool)

Methods

type_

Report the type of the value.

Attributes

n_variants

tag

Tag identifying the variant.

typ

defines all possible variants.

vals

The values of this variant row.

tag: int#

Tag identifying the variant.

typ: Sum#

defines all possible variants.

Type:

Type of the sum

type_() Sum#

Report the type of the value.

Example

>>> TRUE.type_()
Bool
vals: list[Value]#

The values of this variant row.