nustack
ReferenceNuinspect

interaction

The interaction kind: record, parse, verify.

Module nu.inspect.interaction.

The interaction kind: record, parse, verify.

An interaction is an atom: an nu.lang.kinds.Interaction subclass. It is a node in the tree, with children and a kind/sort/cardinality declared on the class. Its args come from the docstring when the constructor is variadic; its yields come from the docstring (there is no return annotation on _compile). What the code says is derived here; what the docstring says is read; the two are checked against each other by the shared laws.

NameCallMeaning
catalogue_interactionsinspect.catalogue_interactions(module)A record per interaction the module exports, in export order.
parse_interactioninspect.parse_interaction(atom, path='', aliases=())One InteractionRecord for atom.
verify_interactioninspect.verify_interaction(atom)Every way atom's docstring lies about the code.

catalogue_interactions

A record per interaction the module exports, in export order.

inspect.catalogue_interactions(module)

Path nu.inspect.catalogue_interactions. Defined on nu.inspect.interaction, bound as a function. Builds tuple[InteractionRecord, ...].

Forms and Refs are excluded. Both are Interaction subclasses by inheritance, so a naive check reports every Form twice - once here and once in the Form catalogue - and the three catalogues stop partitioning the module. Same most-specific-wins dispatch Inspect uses on a single class.

Arguments

NameTypeDefaultMeaning
moduleModuleType

Undocumented: example.

parse_interaction

One InteractionRecord for atom.

inspect.parse_interaction(atom, path='', aliases=())

Path nu.inspect.parse_interaction. Defined on nu.inspect.interaction, bound as a function. Builds InteractionRecord.

Arguments

NameTypeDefaultMeaning
atomtype
pathstr''
aliasestuple[str, ...]()

Undocumented: example.

verify_interaction

Every way atom's docstring lies about the code.

inspect.verify_interaction(atom)

Path nu.inspect.verify_interaction. Defined on nu.inspect.interaction, bound as a function. Builds list[Violation].

Arguments

NameTypeDefaultMeaning
atomtype

Undocumented: example.

On this page