designspace.Signature#
- class designspace.Signature(args: Mapping[str, type | str], returns: type | str)#
Bases:
objectThe interface a .symbolic() or .code() parameter must satisfy.
For a symbolic parameter the argument names also become the variables usable in the tree. Argument order is meaningful and preserved.
Types may be given as Python types or as bare strings; a type is normalized to its name, so the signature stays serializable.
Examples
>>> sig = ds.Signature(args={"x": float, "y": float}, returns=float) >>> dict(sig.args), sig.returns ({'x': 'float', 'y': 'float'}, 'float')