Symbol

class hugr.model.Symbol(name: str, visibility: ~typing.Literal['Public', 'Private'], params: ~collections.abc.Sequence[~hugr.model.Param] = <factory>, constraints: ~collections.abc.Sequence[~hugr.model.Term] = <factory>, signature: ~hugr.model.Term = <factory>, version: ~semver.version.Version | None = None)[source]

Bases: object

A named symbol.

name

The name of the symbol.

Type:

str

visibility

The visibility of the symbol.

Type:

Literal[‘Public’, ‘Private’]

params

The parameters of the symbol.

Type:

collections.abc.Sequence[hugr.model.Param]

constraints

The constraints on the symbol’s parameters.

Type:

collections.abc.Sequence[hugr.model.Term]

signature

The signature of the symbol.

Type:

hugr.model.Term

version

The extension version where this symbol was declared, if any.

Type:

semver.version.Version | None

Methods

from_str

Read the symbol from its string representation.

Attributes

static from_str(s: str) Symbol[source]

Read the symbol from its string representation.