nustack
ReferenceNuinspect

call

The call kind: record, parse, verify.

Module nu.inspect.call.

The call kind: record, parse, verify.

A call is a callable a person or a model writes to build Nu: a bound method like .set(v), an operator like a + b, a classmethod like List.of(x, y), or a free function like nu.str(x). What differs across them is the syntax and where it is bound; the described thing is the same.

Signature and return annotation are authoritative for args and yields, so neither is written; the docstring's job is summary and notes.

A call is reached two ways: off a class, by the MRO walk the builder kinds run, or off a module, by the catalogue here - which is what the nustd surfaces are made of.

NameCallMeaning
catalogue_callsinspect.catalogue_calls(module)A CallRecord per free function the module exports, in export order.
parse_callinspect.parse_call(target, name, path, owner, binding, qualifier='', aliases=())One CallRecord for target, however it was reached.
verify_callinspect.verify_call(target, subject='')Every way target's docstring lies about the format.

catalogue_calls

A CallRecord per free function the module exports, in export order.

inspect.catalogue_calls(module)

Path nu.inspect.catalogue_calls. Defined on nu.inspect.call, bound as a function. Builds tuple[CallRecord, ...].

The other catalogues filter a module for a kind of class. This one is for the surfaces that export no classes at all: nustd.math is 34 plain functions that build Nu terms, and without this every std submodule reads as exporting nothing.

The qualifier is the module's last name part, because that is how the function is written: from nustd import math, then math.sqrt(x).

Arguments

NameTypeDefaultMeaning
moduleModuleType

Undocumented: example.

parse_call

One CallRecord for target, however it was reached.

inspect.parse_call(target, name, path, owner, binding, qualifier='', aliases=())

Path nu.inspect.parse_call. Defined on nu.inspect.call, bound as a function. Builds CallRecord.

Arguments

NameTypeDefaultMeaning
targetobject
namestr
pathstr
ownerstr
bindingstr
qualifierstr''
aliasestuple[str, ...]()

Undocumented: example.

verify_call

Every way target's docstring lies about the format.

inspect.verify_call(target, subject='')

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

Arguments

NameTypeDefaultMeaning
targetobject
subjectstr''

Undocumented: example.

On this page