argdigest.describe_contract#

argdigest.describe_contract(contract, domains)[source]#

Render a contract as plain data, for documentation and introspection.

This is why a contract is declarative rather than an opaque callable: the accepted domain of a function with **kwargs is invisible to inspect.signature, and this is what makes it readable again.

Parameters:
Return type:

dict[str, Any]